God’s purpose in creating the universe was to end up with a heaven populated by angels - people - from the human race. All His laws, which collectively may be called the Divine Providence, are dedicated to that end. One of those laws is that people must be in freedom to choose to follow those laws or not, because only those things chosen in freedom from a love for them is lasting. This means that people may choose to do evil without obvious, external restraint from the Lord. No hand will come down out of the sky, and no terrible voice will call, “stop!”. The Lord can only work internally in each person using what the person has in his or her understanding or conscience. His overarching law that requires human freedom prevents anything else.
The evils that occur in such circumstances are called permissions. They can serve a purpose. In someone who has a conscience, and wants to do what is right, the doing of some evil or even the thought of doing some evil will bring to the person's attention that a love for that evil exists in them, and a resistance to both the thought and deed must be developed so that shunning the evil can become less difficult. When a person who doesn’t have a conscience does evil, and that evil breaks out into external acts, then others can see that open evil. If dismayed by it, they can see that they should avoid it, or if they see an incipient love for it in themselves, they can work to shun any thought of dwelling on it in their imagination, or, worse, doing it themselves. In this way the Lord can make use of evils that arise in hell. In the work entitled "Divine Providence" we are taught that the Lord never allows evils that cannot serve a useful warning purpose that may lead toward salvation.