Eru was infinitely more powerful than the Dark Lords, why didn't he stop them from trying to enslave the Free Peoples?
It was part of Eru's plan? Eru implied as much to Morgoth at least, when he commented on Morgoth attempting to alter the music that created the world.
And thou, Melkor, shalt see that no theme may be played that hath not its uttermost source in me, nor can any alter the music in my despite. For he that attempteth this shall prove but mine instrument in the devising of things more wonderful, which he himself hath not imagined.'
There would be no story.
Following the "World as Myth" interpretation of reality (Robert A. Heinlein), the creatures of Middle Earth by necessity live in an interesting world, because no stories are written about boring worlds. In the infinite multitude of possible worlds, the many in which Eru snapped his fingers and half the universe... err... the evil half of creation disappeared are not manifested in stories.
In-world, Eru is not a god that actively participates in the events inside his creation. In fact, not even all of the Ainur entered Eä. The Valar (the gods of Tolkiens world) are a subset of the Ainur. And Eru himself intervenes at a rate of about once per age. In the first age he created the races of elves and men. In the second age he sunk Numenor. And in the third age, he resurrected Gandalf, at least according to some interpretations.
Could he have eliminated Melkor or Sauron? Most likely, yes. He just isn't that kind of guy.
Why doesn't (insert real world deity of choice) stop nasty things from happening? Possible answers - again, these are real-world ones I've heard - range the gamut from "deity doesn't care/enjoys human suffering" to "it's a learning experience".
Of course for Tolkien, if Eru had, LOTR would have been a pretty short book :-)
The Ainur, each inherited an aspect of Eru which is to say that Morgoth was just as much a part of Eru as any of the other Ainur.
The question is not why would he not stop Morgoth from causing trouble so much as, did he see Morgoth as trouble to begin with. Nature lasts longest when there is a balance between creation & destruction; so, Eru would have likely seen Morgoth's actions with the same approval that a homeowner would have for a gardener pruning his bushes... it's just really hard to see it that way when you are the bush.