The Patristic theologian, Origen, argued for necessary evil which, within God’s providence, can lead to the fulfillment of his purposes:
God does not create evil; still, he does not prevent it when it is shown by others, although he could do so. But he uses both evil and those who show it for necessary purposes. For through those in whom there is evil, he brings distinction and testing to those who strive for the glory of virtue. Virtue, if unopposed, would not shine out nor become more glorious by being tested. Virtue is not virtue if it be untested and unexamined. [. . .] If you remove the wickedness of Judas and cancel his treachery you take away likewise the cross of Christ and his passion: and if there were no cross then principalities and powers have not been stripped nor triumphed over by the wood of the cross. Had there been no death of Christ, there would certainly have been no resurrection and there would have been no “firstborn from the dead” (Colossians 1:18) and then there would have been no hope of resurrection for us.
Following the same logic as Origen, the Puritan poet and statesmen, John Milton, wrote a speech called Areopagitica. He argues for the necessity of trial in the formation of virtue:
Good and evil we know in the field of this world grow up together almost inseparably; and the knowledge of good is so involved and interwoven with the knowledge of evil, and in so many cunning resemblances hardly to be discerned, that those confused seeds which were imposed upon Psyche as an incessant labour to cull out, and sort asunder, were not more intermixed. It was from out the rind of one apple tasted, that the knowledge of good and evil, as two twins cleaving together, leaped forth into the world. And perhaps this is that doom which Adam fell into of knowing good and evil, that is to say of knowing good by evil. As therefore the state of man now is; what wisdom can there be to choose, what continence to forbear without the knowledge of evil? He that can apprehend and consider vice with all her baits and seeming pleasures, and yet abstain, and yet distinguish, and yet prefer that which is truly better, he is the true warfaring Christian. I cannot praise a fugitive and cloistered virtue, unexercised and unbreathed, that never sallies out and sees her adversary but slinks out of the race, where that immortal garland is to be run for, not without dust and heat. Assuredly we bring not innocence into the world, we bring impurity much rather; that which purifies us is trial, and trial is by what is contrary.