5 We by no means wish to conclude that a perverse will and unbridled conduct may not be joined with a knowledge of religion. Would to God that facts did not too abundantly prove the contrary! But We do maintain that the will cannot be upright nor the conduct good when the mind is shrouded in the darkness of crass ignorance. A man who walks with open eyes may, indeed, turn aside from the right path, but a blind man is in much more imminent danger of wandering away. Furthermore, there is always some hope for a reform of perverse conduct so long as the light of faith is not entirely extinguished; but if lack of faith is added to depraved morality because of ignorance, the evil hardly admits of remedy, and the road to ruin lies open.
Source: Acerbo Nimis (Vatican.va)