Miguel Farias, in his article on "The Psychology of Atheism" argues that people cannot not believe, that when we discard one fundamental belief (or system of beliefs) we have to switch to another fundamental belief . A longer period of nonbelief would be rather unpleasant and difficult to maintain.
Farias calls this the belief replacement hypothesis:
"...those who reject religion, intuitively choose something else to replace it with. This can be briefly enunciated as the belief replacement hypothesis. Whether explicitly or implicitly, atheists will espouse various types of naturalistic beliefs that are meaningful, help them to explain the world and, ultimately, can play a compensatory role in dealing with adverse circumstances. Existentialism, New Atheism, Humanism and Marxism are examples of beliefs systems associated with atheism."
Nonreligious people in general may also use a faith in humanity’s moral progress to find comfort or security, in the same way religious people use their belief in God.
"... perhaps belief in science is emotionally reassuring when an atheist faces adverse situations, because it provides a tightly ordered understanding of the world that eschews randomness — similar to what religion achieves through the idea of a governing deity.
"This clearly lends support to the belief replacement hypothesis. Further, this finding has a relevance which extends far beyond the study of atheism and religion. It tells us something about the nature and role of beliefs. It seems that it is not so much the content of the belief, but its meaningfulness and strength that truly matters. Despite the difficulty in deliberately choosing what we believe in, beliefs offer structure to our lives, and we cling on to them when facing trying and uncertain situations."
(Miguel Farias, "The Psychology of Atheism" , in: The Oxford Handbook of Atheism)