You have to go deeper than that, though. Eru Ilúvatar said this to Melkor:
> 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.
The idea being that the evil that Melkor commits ultimately just builds towards the creators greater and secret purpose. It's kind of an attempt to deal with the "problem of evil".
> 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.
The idea being that the evil that Melkor commits ultimately just builds towards the creators greater and secret purpose. It's kind of an attempt to deal with the "problem of evil".