Well, I hope I’m not annoying people by answering these – I think I should just mention that these are my opinions, and they’re neither right or wrong. They’re opinions, and TOTALLY subjective. Other people take different things away from the text, and that’s awesome, that’s why we engage with it.
So, I think I should also say that I don’t think Gandalf is a dick at all. I actually love him a whole lot. I have a major problem with the fact that people suffer and die as a result of his decisions – but it’s also true that he has to make those decisions for the sake of ALL lives. In the Appendices he mentions the consequences of leaving Smaug in Erebor – and they are CATASTROPHIC. Smaug is a creature designed by Sauron’s master, they are similarly aligned. If Smaug had decided to join with Sauron, ‘Think of what might have been. Dragon-fire and savage swords in Eriador, night in Rivendell. There might be no Queen in Gondor. We might now hope to return from the victory here to ruin and ash.’
Gandalf cares about all these people. He really really does. We learn in the Silmarillion that he was a pupil of Nienna, the weeping Valier, and from her he learned pity and compassion. He’s basically an angelic being, and he has no obligation to go to Middle-Earth. We find out also that he didn’t want to be an Istari – he wanted to stay in the Gardens of Valinor. Manwe told him he must, though – and so he obeyed. He is Faramir’s friend, he is Belladonna’s friend, he is Bilbo’s friend, he is Aragorn’s friend, he is friend to many. Won’t stop him from using them, though.
I have no answers to the moral quandary of lives-of-a-few vs lives-of-many. I don’t like it, but I don’t think it’s meant to be an easy thing to accept. I think it’s probably meant to be hard. It is undeniable that Gandalf sacrificed himself as well as others, that he debased himself and worked tirelessly and even passed through death, and that he was ultimately victorious. But people were hurt who might not have been, and people died who might never have ventured near danger at all in their lifetimes. Who’s to say? We don’t know what would have happened if he hadn’t meddled.