4 Nevertheless to restrain the danger of socialism there is only one genuinely effective means, in the absence of which the fear of punishment has little weight to discourage offenders. It is that citizens should be thoroughly educated in religion, and restrained by respect for and love of the Church. For the Church as parent and teacher is the holy guardian of religion, moral integrity, and virtue. All who follow the precepts of the Gospel religiously and entirely are, by this very fact, far from the suspicion of socialism. For religion commands us to worship and fear God and to submit to and obey legitimate authority. It forbids anyone to act seditiously and demands for everyone the security of his possessions and rights. It furthermore commands those who have wealth to come graciously to the aid of the poor. Religion aids the needy with all the works of charity and consoles those who suffer loss, enkindling in them the hope of the greatest eternal blessings which will be in proportion to the labor endured and the length of that labor. Therefore those who rule the states will do nothing wiser and more opportune than to recognize that religion influences the people despite all obstacles and recalls them to virtue and uprightness of character through her teachings. To distrust the Church or hold it suspect is, in the first place, unjust, and in the second, profits no one except the enemies of civil discipline and those bent on destruction.
Source: Quod Multum (Vatican.va)