I see the doctor like every other character with a singular focus on accomplishing a goal. He joined a terrorist organization, they are killing countless people for political reasons (their goal is to bring back all branches of government, and they blow people up and hang people in public). He certainly failed his hippocratic oath wanting to kill an innocent girl for the cause, and he's the one who convinced Marlene to do it.
It's the trolley dilemma: would you actively sacrifice an innocent person if you think it will save more people in the end.
Marlene promised Ellie's mother she'd look after her. Then she was ready to kill her for her cause. There are hints throughout the game that they embellish the cause for recruitment. Joel said laughing "we've heard that one before didn't we Tess?" as a dismissal that the fireflies are often making claims of saving the world which are overly optimistic.
There is no indication that whatever the doctor was working on was a certainty. They don't know how many mutations there are. During the title intro of the first game we hear "the latest vaccination attempt has failed", meaning the entire world at it's best was unable to make a vaccine. So it's a very difficult goal to accomplish with no guarantee of success.
The different organized groups are dealing with infected through simple pest control. They are blocked by a simple fence so it's not that big of a deal. Most deaths are unrelated to the infection, they are political conflicts. Even if the fireflies (or any other group) had access to a vaccine, they would use it to increase their mobility through infected areas, and take over any other faction, they wouldn't mass produce it to give everyone, certainly not to their enemies. It would be another recruitment tool. Their cause is a political one, not a medical one. They would use it to gain an advantage, as would any other faction.
The fireflies have proven repeatedly in the first game that they don't care about anyone's life. They were even letting Ellie die while Joel was trying to bring her back. Marlene dismissed it as "it's okay they didn't know who you were". Meaning they don't give a shit about lives unless it's useful for the cause.
The fireflies will have changed after Marlene is gone, so it can go in any direction.
Saving Ellie was the right decision, killing the doctor was unavoidable since he pulled a knife. "It can't be for nothing" is a horrible point of view that Ellie didn't have early in the game and Joel is responsible for this one: she didn't want to continue the journey to the fireflies while Joel kept trying to convince her "do you have any idea what your life means?" which later became "we don't have to do this, you know that right?" as Joel realized what her life actually meant, instead of the mere practicality of her immunity for making a vaccine. It was too late, she wanted her suffering, efforts, and losses, to have meaning. She was already in a bad state of mind "waiting for her turn" to die. As if she was meant to die with her friend, but that poetic ending was robbed from her because she's immune. And the second attempt at giving her life meaning was robbed by Joel. It was still the correct decision.
Each character throughout the two games have a justification for their violent acts. The most immoral justifications were "for revenge", "for closure", "for the cause", and to a lesser extent "for survival" which is sometimes reasonable sometimes a stretch. The more interesting justification is "to save/protect loved ones" which is a slippery slope because none of these violent acts exist in isolation without consequences, but I am more sympathetic to those justifications despite the amplification it provided to the cycle of violence and making everything worse. Again that one can be reasonable (saving Ellie), or it can be twisted enough to justify wiping out an entire faction to stop the war.