Freud describes cultures as needing ideals that can reign in the drives and desires of individuals.
Religion is the most important ideal a culture has, and therefore a culture discourages questioning its religious beliefs. But religion is also based on a wish that is left unfulfilled, and as such, religion can entrap believers in an unhealthy relationship that prevents the maturity of individuals and cultures alike.
Freud sees religion as the adolescent stage of a culture; much as a child learns its parents’ ideals in order to become a part of a family, religion is a set of unquestionable norms needed for a culture to cohere. But the adolescent must begin to rebel against those same ideals in order to become an independent adult.