So I just finished the game and my gf and I were talking about the ending and Joel's decision.
I pointed out that I'm not entirely sure it really mattered...
Doesn't humanity face basically the same problem with or without the vaccine? Crap loads of existing infected and spores all over the place, which ultimately need to be destroyed/killed if humanity is ever going to reclaim full control of the planet.
Of course, being immune to the spores helps in that goal... and not adding to the infected numbers helps that goal too, but they have masks... and ultimately the only way to really clear up the infected is large numbers of organized, well armed people sweeping and clearing areas. That is the case with or without a vaccine! Sure, the caution levels have to be HIGHER without it, but the infected were attacking and killing Ellie just like anyone else... it's not like they don't attack people with her strain of it.
I don't believe they could successfully produce the vaccine in the necessary quantities and spread it to all the isolated, hostile, disorganized pockets of humanity anyway. And how can they be sure that it's safe? Maybe having those growths in her brain was eventually going to kill Ellie. She'd only lived 14 years so there's no way to know the long term course of that modified infection. It would be rather rash to purposefully infect everyone else with it.
So ultimately, I think Joel made the right call even if it wasn't for the right reasons (though maybe it was.)