We are constituted so that simple acts of kindness, such as giving to charity or expressing gratitude, have a positive effect on our long-term moods. The key to the happy life, it seems, is the good life: a life with sustained relationships, challenging work, and connections to community.
It is clear that rituals and sacrifices can bring people together, and it may well be that a group that does such things has an advantage over one that does not. But it is not clear why a religion has to be involved. Why are gods, souls, an afterlife, miracles, divine creation of the universe, and so on brought in?
Natural selection shaped the human brain to be drawn toward aspects of nature that enhance our survival and reproduction, like verdant landscapes and docile creatures. There is no payoff to getting the warm fuzzies in the presence of rats, snakes, mosquitoes, cockroaches, herpes simplex and the rabies virus.
Empty heads, cognitive science has taught us, learn nothing. The powerful cultural and personal flexibility of our species is owed at least in part to our starting off so well-informed; we are good learners because we know what to pay attention to and what questions are the right ones to ask.
Strong moral arguments exist for why we should often try to ignore stereotypes or override them. But we shouldn't assume they represent some irrational quirk of the unconscious mind. In fact, they're largely the consequence of the mind's attempt to make a rational decision.