Cause they're cool like that.
BECAUSE THE PROPHECY SAIDS SO! don't ask me how prophecies work cause harry potter doesn't expalin anything of that sort.
When Voldemort tried to kill Harry as a baby, his spell was deflected by a charm cast by Harry's mother. This is what did Voldemort in (at that time). What was left of his soul looked for the nearest living thing and that was Harry. Voldemort inadvertently turned Harry into a horcrux. That's why Harry had to die at the end so that he would no longer be a suitable vessel for a horcrux. That way, once Nigini (Voldemort's snake and also a horcrux) was killed, Voldemort would be vulnerable and could be killed.
I'm not sure if this question is meant to be about the prophecy or the ending. The prophecy is self-fulfilling - Voldemort believes it, therefore he will never stop trying to kill Harry because he thinks he has to; since Voldemort keeps coming after him, Harry will naturally keep fighting him and the cycle won't end until someone dies.
As for the ending, Harry is a Horcrux (a piece of Voldemort's soul is magically contained inside him) so as long as Harry lives, the piece of Voldemort's soul lives too, so Voldemort can't truly be destroyed. When Voldemort tried to kill baby Harry, Lily saved him by sacrificing herself (she didn't cast a charm, but her act creates some "old magic" that protects Harry). Harry carries the magic of Lily's sacrifice in his blood apparently, and in Goblet of Fire, Voldemort used Harry's blood in that crazy spell. Thus, the sacrifice-magic is carried around in Voldemort as well. So, as long as Voldemort lives and carries around the magic blood of sacrifice, that protection will last, so Harry can't die.
When Harry goes to die at the hands of Voldemort, he actually can't be killed because Voldemort keeps that magical protection alive. But Voldemort's attempt destroys the piece of his soul inside Harry, so after that he can be killed even if Harry is still alive.