It's demonstrated in the cutscenes that you see him in that the undead won't attack him. In fact, they seem to do whatever he wants them to do, and don't object to dancing or playing cards. Now at the end of the story, Seth steals the mask that causes the Zombie Apocalypse. By being in possession of the only thing that can stop the apocalypse and being immune to zombie attacks, basically nobody can stop him. Except for maybe the only zombie with a soul...
Upon crawling out of the grave, Marston finds Death waiting for him. God has selected him to become the new Grim Reaper, the old one obviously not doing his job. Because he mastered the other horses of the apocalypse, who were let loose to select new bringers of the end times as the old ones let it happen to early, he is now the Single Rider of the Apocalypse
In the WMG section of Red Dead Redemption there is a quite compelling theory of that the main storyline is book Jack Marston wrote of his father exploits, written so John looks like a good guy and most other fellows are... well idiots and complete assholes. The starnger quest are not a part of the book and are things that happens outside the books story, since Jack can finish them and when you kill Ross it is not an official mission. That being said, the same goes for undead nightmare, being a completely fictional story Jack might have inspiration from the book his is reading in the begin.
So why do John still dies at the end when Jack could easily just have made up a happily ever after story. Because Jack hates Ross to death. What would magnificent asshole do when you should focus on rebuilding society? He goes after the guy have meant to kill but where unable to because of a very inconvenient apocalypse, but when that was over he had his chance. Didn't need to kill him, he could easily have said John died during the undead plague but no sir he wanted John dead for real. Or at least so Jack portrays Ross in his books, like an evil asshole that just look out after himself.
His family is once again taken away from him, he must once again kill people by the score, and in the end he once again dies only to rise up as an undead monstrosity and stalk the world; he can never escape his violent existence, even in death. The fact that he's in hell is why supernatural elements like the Four Horses and sasquatches now exist. In fact, the mission with the sasquatches is a perfect example of the universe confronting him with his sins in a What the Hell, Hero? moment; he kills others simply because he was told to, without seeking an alternative or stopping to consider whether it is really necessary. John's life in a nutshell.