Looking at this from a view of what simple
pleasure I got from the books, I am certainly glad that Gandalf came back. I can see that Tolkien could have made a worthwhile point about the bravery of Men and Hobbits and the transition into the 'age of Men' by having them figure out how to beat Sauron by themselves, but there is something essentially fantastic about having a
wizard throughout the story. Gandalf adds more simple magic to the tale, and when he 'dies' in Moria, it provides some suspense for the reader. I am sure I'm not alone in being horribly disappointed when in the Arthurian tales, Merlin is trapped by Nimue. The wizard, and hence all the magic, has gone!
I felt this way a little about the death of Smaug in The Hobbit. Wizards and Dragons are essentially wonderful, and putting aside plot and style and theme, appeal to me on a fundamental level. I have a sneaking suspicion Tolkien felt the same way and so would have been unable to kill off Gandalf even if he had wanted to. Maybe that is why he does come back to us. I wonder if HoME says anything about this?