I would argue that Midnight is one of the most important Doctor Who stories, because of the moral ambiguity of the Doctor and the humans. Throughout 10's era, he has loved humans the most out of any incarnation, almost in a naiive sense, so having humans turn against him, and then in turn, turning against the humans, especially with the dialogue "because I'm clever!", I think helped with the ambiguity of 10's relationship. The era also tried to address that 10's arrogance is seen as a reckless personality, with stories like Tooth and Claw, Sound of Drums, Voyage of the Dammed, Midnight and Waters of Mars showing that 10 having a God-like complex is harmful to him and others. And I like that, and I wished they explored that more. The problem was that End of Time completely throws all of that potential out of the window, and says that 10 was completely in the right and he's right to feel like this. God I despise End of Time, I feel bad that Tennant, Cribbins and Dalton got thrown into that piece of shit story.
In terms of the Classic era, I'd say that the Massacre is also a great story to analysing the moral ambiguity. Steven's argument against the Doctor and whether the Doctor's actions saved or killed Anne is a great form of debate on if the Doctor should save someone.
I would definitely say that the 8th Doctor is the most morally ambiguous Doctor next to the 1st Doctor, more specifically in the Eighth Doctor books. He does a lot of grey actions. Especially with his memory lost, because he's exactly how he was in An Unearthly Child, only more athletic. The difference is that there is no form of Ian or Barbara to hold him back.
The Burning. After a firestorm hits Middleton and magma creatures infest the town, the Doctor is forced to blow up the village's dam, so it can flood and kill the creatures. The main bad guy gets swept up in the flood, and begs the Doctor for mercy. It looks like the Doctor was going to give the guy pity and save him, but instead pushes him down in the water so he can drown.
The Turing Test. The Eighth Doctor helps one side of an alien race to help them repair their ship, so they can escape Earth with the Doctor on-board (his Tardis is taking a 100 year repair, and the Doctor is getting impatient of waiting). Problem is that the Doctor is only doing this for his own gain, rather than helping the alien race. So, he will do anything necessary to reach that goal. Such as manipulating Alan Turing and using his sexuality as blackmail so Alan can help use the code breaker to help with the alien race.
Eater of Wasps. When a guy gets infested with killer wasps in 1930s, he ends up sprawling about in agony and pain, The Doctor is forced to snap the person's neck, so the person doesn't have to suffer any longer. Later, he performs an autopsy on the body to see the wasps pattern. Then, when the wasps make the body convulse, the Doctor sets the body alight to stop the wasps.