I review this question with the same philosophy as I do review the dilemma of suffering and theology in this world. The Ainur are from Eru's own thoughts, true. But it would appear that he gave everyone a free will, including the Ainur, and that includes choosing the paths that we generally regard as the hurtful ones. He interfered to the events only when asked by the Valar. It also reads that the Ainur failed to understand each other at first, but they learned to do that eventually and work together. Free will is a two edged blade that way, but eventually it's better to have it than just have us all as puppets or slaves. Should you allow the free will, you allow the chance of both good and evil, whether you like it or not. But as a result, we get many stories to be inspired by, to learn many lessons. It gives a lot more value to everything, knowing that our personal choices really did influence the results. In the end it's wealth. So what is Melkor about? "One who rises in might", which means an ambition great enough to end up with jealousy when he sees the others thriving together. In other words he really wants to be the leader but isn't fit to be one. The reason why Manwë is the greatest in authority but not in power is that he's the one who's fit. He actually listens. Melkor was the one who refused to work with others the most, and wanted to see himself on top instead, alone. His ambition dictated to challenge the other Valar instead and work with no one – even if he gained a few followers which is Mairon, Valaraukar and Thuringwethil at least. Ungoliant is more independent, and only cares about herself and her offpring (Shelob). The question is though what Eä would have been like if Melkor chose otherwise or if Varda would have chosen him instead. The challenger would have probably been someone else, I reckon. But in the world of canon there really isn't that much room for "what ifs". There's headcanons and fan fiction for all that.