Adam Smith on Religion and the Rules of Morality

Found in The Theory of Moral Sentiments and on the Origins of Languages (Stewart ed.)
The Scottish moral philosopher Adam Smith (1723–1790) was the author of two books, The Theory of Moral Sentiments (1759) and An Inquiry into the Nature and Causes of the Wealth of Nations (1776).
In The Theory of Moral Sentiments, Smith discusses the development of moral rules. In Smith’s account, moral rules result from a “habitual reverence” (III.5.2), a deep feeling of respect learned and strengthened over time by seeing and feeling the socially appropriate moral reactions to behaviour and misbehaviour in a given society.
These natural hopes, and fears, and suspicions, were propagated by sympathy, and confirmed by education; and the gods were universally represented and believed to be the rewarders of humanity and mercy, and the avengers of perfidy and injustice. And thus religion, even in its rudest form, gave a sanction to the rules of morality, long before the age of artificial reasoning and philosophy. That the terrors of religion should thus enforce the natural sense of duty, was of too much importance to the happiness of mankind, for nature to leave it dependent upon the slowness and uncertainty of philosophical researches. (FROM: Chap. V.—: Of the Influence and Authority of the general Rules of Morality, and that they are justly regarded as the Laws of the Deity) - Adam Smith
Sympathy helps first to develop moral senses. A person naturally feels approval for praiseworthy actions and enjoys seeing that feeling confirmed by the reactions of those around them. Likewise, they naturally feel disapproval for blameworthy actions, and again find confirmation in the reactions of their fellows.
Education generalizes the product of our moral senses into moral rules. Over time, repeated experience produces guidelines that can be followed even when momentary passions, such as anger or excitement, override someone’s normal moral sense. Smith uses the example of being polite to a visitor even when a host isn’t in the mood to receive them.
The societal importance of moral rules is what makes them naturally feel worthy of reverence. As a result of this reverence, and to reinforce it, Smith describes how pagan religions ascribed to the gods the best aspects of humanity and ascribed to them responsibility for ensuring justice.