Ultimately, I cannot claim to be able to provide the reason God allows such things. Short of a revelation from God Himself (which I’ve yet to receive), the best I can do is offer what might be called a “just-so story”, which is a scenario that, for all we know, could be true (in that it does not seem especially implausible, given minimal theistic assumptions) and is such that if it is true, would suffice to explain why God allows a good bit of the evil he allows. The lesson to be drawn from such a procedure is that if I, a finite human being of average intelligence can envision a scenario that would adequately explain the existence of evil, then certainly an infinite God would have little trouble doing the same.
Fundamentally, the existence and exercise of free will plays a large part in this story. Now given theism, the intrinsic value of free will can hardly be questioned, given that God is supposed to have free will and everything about God is good. Thus it is also good that God should give us free will. But at this point two questions confront us squarely; first, if God has free will and does not have the capacity to do evil, why not bestow free will upon creatures in such a way that they too do not have the capacity to do evil?
The answer to this may simply be that God has already created beings whose characters are fully actualized upon a single choice (viz. angels), and that he wished to also create beings whose characters would develop gradually—as determined by the nature of the morally significant choices they would make over large stretches of time. If this is the case, then evil seems as though it would have to be a genuine option for them if their choice of character is to avoid being trivial (since, if one could only choose between various goods, making one particular choice over another would be irrelevant).
The second question wonders how free will fits into all this, given that the examples mentioned above are all “natural” in character. The supposition at this point is that nature has become corrupted and that much of what passes for natural evil is actually evil perpetrated through the free will of malevolent spiritual forces, or the fallen angels.
Once that allowance is made, one can attribute the vast majority of the evil in the world to the exercise of free will. But since the possession of free will is a good, the allowance of the evil it chooses is a good as well.
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