There are, however, a couple of problems with this line of reasoning that aren't usually recognized. To begin with, the relationship between the evil that God allows and the higher purpose it serves must be logical, and not merely causal. Apologists usually fail to understand this. Take the claim that God is justified in allowing the death of some innocent people today in order to prevent the deaths of a far greater number of people in the future. Such a causal relationship between events isn't sufficient to warrant God allowing any evil, and it's easy to see why: whatever future event might be prevented could be prevented directly by an all-powerful being by means of a miracle. God isn't limited by the laws of cause and effect that operate in the physical universe, as he is the author of those very laws and can override them. It follows that he can be justified in allowing some evil only if that evil is logically necessary for achieving some higher purpose – and most things that theists think of as examples of a higher purpose fail in this regard.
A second problem with the theist's claim that God is compatible with evil is that it is too general. While it is true, strictly speaking, that God is compatible with the existence of evil, it doesn't necessarily follow that he is compatible with every evil, or even with every kind of evil, that we find in the world around us. If it can be shown that a perfect being is logically inconsistent with some specific existing evil, then it can be shown that such a perfect being does not exist. And – though I won't argue for it here – such a thing is in fact fairly easy to demonstrate, and is one of several arguments against theism that I present in my forthcoming book, The Truth about God.
It follows that some versions of the argument from evil do show that there is no perfect God.