[M]any goods are present in things which would not occur unless there were evils. For instance, there would not be the patience of the just if there were not the malice of their persecutors; there would not be a place for the justice of vindication if there were no offenses; and in the order of nature, there would not be the generation of one thing unless there were the corruption of another. So, if evil were totally excluded from the whole of things by divine providence, a multitude of good things would have to be sacrificed. And this is as it should be, for the good is stronger in its goodness than evil is in its malice, as is clear from earlier sections. Therefore, evil should not be totally excluded from things by divine providence.
Thomas Aquinas, Summa Contra Gentiles 3.71.6.