Religion, in Freud's view, was simply a poor attempt to resolve the needs that often go unmet in human relationships. He developed this idea over 30 years in his enormous body of work, making it the main focus of his 1927 book, The Future of an Illusion, and extending his arguments from individual to society in his long 1930 essay, Civilization and Its Discontents.
"Religion may be altogether disregarded," he wrote in the latter work, "Its doctrines carry with them the stamp of the times in which they originated, the ignorant childhood days of this human race."
To be truly civilized, he believed, humanity had to be set free of its delusions and construct a better order than religion could give it.
Freud's atheism was not shaken by personal tragedy, though he experienced plenty of it.
The proud father of six children, Freud saw two of his sons sent to fight in World War I and lost his daughter Sophie to the flu epidemic shortly thereafter. Cancer of the mouth plagued him for most of his adult life, and led to over 30 operations, through which he never stopped smoking.
Freud's Jewish heritage made him a target of the rising anti-Semitism under Hitler's regime, and ultimately forced him to flee with his family to London in 1938. In response, Freud worked all the more fervently on what was to be his final work, Moses and Monotheism.
This 1939 book was a retelling of the Hebrew Scriptures that casts Moses as a secular Egyptian hero whom the Israelites reject because his beliefs are too radical, paralleling the psychologist's feelings about his own work in the world.