Well, even ignoring the obvious point that there were still stories to tell regarding Anya, including making her peace with Xander, not to mention the fact that she was a popular character and her fans wanted her around until the finale, Emma was contracted for a full season, so that is one hell of a good reason why they didn't kill Anya off in episode five! 😉
The fact is that all the characters were potentially going to be never seen again after Chosen. There is still no guarantee we will ever see a Buffyverse adventure onscreen again, so you could say why didn't they let Dawn die in Potential when her life was in danger, or why not let Xander die in First Date, or Giles, or Kennedy, or ...
But you get my point? All the characters were in a life threatening position at some point in the final season prior to the end and all of them were potentially going to never be seen again after Chosen. Joss wanted all his Scoobies there to fight and, in some cases, die at the end. That is the only real answer to your question.