There is a very big difference between killing a person as a murder and as a way to save the entire planet, and she wanted it herself.
Ellie was going to die for the vaccine, not because the doctor choose to kill her, that's what I'm talking about, the doctor was innocent, he was saving the world and Ellie was collateral damage (which is still not good, but he is not doing it because he wants to).
And in the sequel you see he is still sad she would have to die for it, thinking about what would he do if she was his daughter, aka, the dillema Joel was into.
About if they were able to not kill her and still get a cure, pay in mind that it was the world 20 years after the apocalipse, and they were a revolutionary army in the brink of destruction, they didn't have anywhere close the same means, resources and capacity for such delicate surgery as they would in the world before the outbreak.
They explain the only way to develop the vaccine is to extract the part that growns in the brain, which I don't even know if modern science was able to without killing the patient.
The fungus grows in the brain (which is evident everywhere, from the story to the infected evolution stages as well), and at least in the story, only having access to the part of Ellie's brain that was able to fight back the fungus growth they could understand what was the cause and develop a cure.
If these surgeons think they can extract the parasite from Ellie, surely they would be able to extract a sample out of Ellie without killing her. I have to wonder, did they even try to first run some non-invasive tests? MRIs or X-Rays? Why must they automatically resort to a procedure that kills the patient? What if they kill the parasite in the process thus potentially losing a very valuable resource?
I imagine the parasite is living off of Ellie and if Ellie dies, the parasite dies too: it's much better to keep the parasite alive by keeping Ellie alive so you could extract multiple samples and run multiple and various tests.
Like I said, these firefly doctors seem like idiots to me. Joel was right to take Ellie at the end of the first game.
For 20 years all kind of research was done in everything possible and no way to fight back the fungus was ever developed, it's definitely not a simple process to make the cure, and the consensus probably was that something in the brain, the main infected body part and that was where the fungus evolution happens, was what could give them an answer to develop the cure.
The fireflies were being destroyed by that point, that gets evident from the beginning of the game where their own leader almost died alone trying to personally scort Ellie, and during the whole game as its all about going to places they are supposed to be and finding out they already left or got chased away from there, time after time. So they didn't have time or resources to keep any kind of prolongued tests and study that might result in nothing and endangers Ellie to the point they could lose their chance of doing what was probably the most effective way (as in, they get into a fight while still running some tests and Ellie get a bullet in the head and destroy her brain and with that their chances of using it).
Also, I agree with you that Joel should take Ellie away, because the whole game showed us how it was not worth to let her die to cure all the bastards you crossed.
But Joel was blind by his second chance of being a father and to save her as she couldn't with Sarah, and also, Ellie was changing him back into a good person, Joel did lots of shit before he met Ellie, the same way the bastards you fight to protect her from were doing.
But Joel did a bad thing again the in that process. He killed lots of people that were only trying to protect the cure for what was the primary cause of all the bad things that happened in the world and changed all of them.
Also killing Abby's father was unavoidable in the original game, while the other doctors/assistants were optional (and by Abby's memory on the second game you can see the cannon was that he only killed that one and not the other two), and Marlene too later.
Those two deaths were completely optional, one he should simply bash the guy away or break his arm, and the other to cover the lies he was about to make to Ellie.
The ending of the game showed that even as a lot of us agreed with Joel saving her, that he was still doing bad unnecessary things too. Actually that was one of the biggest points of conversation back in 2013 when the original came out, those two deaths always sparked a lot of debate, specially the doctor one, it was common to talk about if you would save Ellie and if so if you would do it how Joel did.
That being the spark for the follow up, both to present a character (Abby) that by her side could only see Joel as the bad guy, and to introduce the new factions to fight against in the sequel by the connection of that new character (Abby).
The Wolfs were not just thrown into you out of nowhere and with no reason, they were effectively searching for Joel for years because of that, and by confronting them you got to confront their own enemies, the Seraphites, as well, getting mixed up in their fights.
Everything about the 2 games looks very well thought about and insert there for a good reason, to me, well, except maybe
letting us wander into Jackson as we were supposed to, to know a little more of the people there so we could care a bit more about them by the point the main story starts to develop
, but even that was only a missed opportunity, not an actual issue.