Culture, as it relates to adaptation, is essentially a tool used by humans to come to a decision as to the best means to survive in a given situation. Part of this decision is rational thought. Also, although it often does not seem like it, cultural beliefs and practices follow a kind of logic. Although they appear in societies at random, those that give greater survivability to those who pracitice/hold them tend to persist, while those that result in death of those that practiced them die out. If rational thought played no role, people would continue to practice cultural norms until they themselves were extinct.
Also, regarding religion in a completely biological fashion, partaking in religion allows for greater longevity and ability to survive difficult times. As the psychiatrist Dr. Victor Frankl observed among those in Nazi concentration camps, those that had some meaning to their lives survived while those who did not perished. Religion provides this meaning for many people, be the religion true or not.