While much of the previous answer applies to this question as well, the wrinkle one now has to confront concerns why God allows as much of the evil that he does rather than eliminating at least some of it once he sees it rearing its ugly head. Part of the reason, it seems to me, that God permits much of what he does is because he does not have Middle Knowledge. If he doesn’t, it is not as though he can form an intention, find out what is going to happen if he goes forward, and then decide (based on what would happen if he proceeds) whether or not to go along with it. What this entails is that once God decides to endow creatures with free will, he can’t (upon seeing what they would do) tinker with the circumstances to get precisely what he wants. Instead, he timelessly wills to respond in certain ways based on what his creatures end up freely doing. Thus while he remains sovereign over the world, creaturely free will is not something he can micro-manage after the fact. What he does is respond appropriately to whatever his creation does, and in those responses brings good out of the evil he allows.
You may also be interested in A Good Reason For Evil and When Good Is Evil and
The Strength of God And The Problem Of Evil and Augustine On Evil
Also The Problem of Evil