I agree with Rhod the Red. It was essential to the story for Gandalf to come back. If he stayed dead, would the men of the west even have survived? Denethor would have possibly fled Minas Tirith, without Gandalf to command a defense. Also, no dialogue between Gandalf and the Witch King, or the Mouth of Sauron. And, very importantly, possibly no aid from Erkenbrand during the Battle for Helm's Deep.
Gandalf was needed, no questions about it.