Board Thread:Suggestions Forum/@comment-72.186.237.217-20141221021624/@comment-72.186.237.217-20150105155518

Well, if you think about it, it wasn't that Eru's creation wasn't good enough. It's just that the Balrog, a creation of Sauron, happened to overpower Gandalf, causing Eru to realize how powerful Sauron could become and giving Gandalf a serious level-up.

TL;DR: Sauron was better than Gandalf, so Eru made Gandalf powerful enough to take on Sauron's forces.