If God the Father almighty, the Creator of the ordered and good world, cares for all his creatures, why does evil exist? To this question, as pressing as it is unavoidable and as painful as it is mysterious, no quick answer will suffice. Only Christian faith as a whole constitutes the answer to this question: the goodness of creation, the drama of sin and the patient love of God who comes to meet man by his covenants, the redemptive Incarnation of his Son, his gift of the Spirit, his gathering of the Church, the power of the sacraments and his call to a blessed life to which free creatures are invited to consent in advance, but from which, by a terrible mystery, they can also turn away in advance. There is not a single aspect of the Christian message that is not in part an answer to the question of evil.
But why did God not create a world so perfect that no evil could exist in it? With infinite power God could always create something better. But with infinite wisdom and goodness God freely willed to create a world “in a state of journeying” towards its ultimate perfection. In God’s plan this process of becoming involves the appearance of certain beings and the disappearance of others, the existence of the more perfect alongside the less perfect, both constructive and destructive forces of nature. With physical good there exists also physical evil as long as creation has not reached perfection.
Angels and men, as intelligent and free creatures, have to journey toward their ultimate destinies by their free choice and preferential love. They can therefore go astray. Indeed, they have sinned. Thus has moral evil, incommensurably more harmful than physical evil, entered the world. God is in no way, directly or indirectly, the cause of moral evil. He permits it, however, because he respects the freedom of his creatures and, mysteriously, knows how to derive good from it:
For almighty God. . ., because he is supremely good, would never allow any evil whatsoever to exist in his works if he were not so all-powerful and good as to cause good to emerge from evil itself.
From the Catechism of the Catholic Church 309-311