33 Yet, with the discernment of a true mother, the Church weighs the great burden of human weakness, and well knows the course down which the minds and actions of men are in this our age being borne. For this reason, while not conceding any right to anything save what is true and honest, she does not forbid public authority to tolerate what is at variance with truth and justice, for the sake of avoiding some greater evil, or of obtaining or preserving some greater good. God Himself in His providence, though infinitely good and powerful, permits evil to exist in the world, partly that greater good may not be impeded, and partly that greater evil may not ensue. In the government of States it is not forbidden to imitate the Ruler of the world; and, as the authority of man is powerless to prevent every evil, it has (as St. Augustine says) to overlook and leave unpunished many things which are punished, and rightly, by Divine Providence.(10) But if, in such circumstances, for the sake of the common good (and this is the only legitimate reason), human law may or even should tolerate evil, it may not and should not approve or desire evil for its own sake; for evil of itself, being a privation of good, is opposed to the common welfare which every legislator is bound to desire and defend to the best of his ability. In this, human law must endeavor to imitate God, who, as St. Thomas teaches, in allowing evil to exist in the world, "neither wills evil to be done, nor wills it not to be done, but wills only to permit it to be done; and this is good."(11) This saying of the Angelic Doctor contains briefly the whole doctrine of the permission of evil.
Source: Libertas (Vatican.va)