Christianity has whats known as the "problem of evil", if God is love why is there evil in the world?
We do not have this problem in Islam. We believe that God creates good and evil - although the evil does not return to him. Evil is created so we can know good, evil is what we have earned because of our actions.
As for the devil he was the most pious worshipper but he had something in his heart that only came out in a certain circumstances and that was the creation of Adam (upon him peace).
Know that both good and evil are under the control of God.