Spencer ridiculed the notion that morality could be taught in any way and by any means, contrary to Comte’s belief that morality could be taught to people, primarily via the positivist religion.
Spencer held the view that moral principles develop via personal choice. Spencer used the survival-of-the-fittest theory to get this conclusion. He reasoned that in this particular situation, the demands of an ordered existence would compel individuals to behave in accordance with their higher moral feelings and suppress their lower sentiments.
People would be rewarded for acting morally and punished for acting immorally. Virtuous deeds are more likely to endure than immoral ones. According to Spencer, the natural selection of moral behavior is national education alone.