Sadly, I've seen perfectly intelligent individuals rationalize being involved heavily in their religion. They use God as a barrier to understanding, instead of working through rationalizing exactly what is going on in the world.
It's much easier to believe that there is an outer hand guiding our behavior and the happenings in the world. It's simple, and we can say, "Well, that's God's plan" and move on without having to think it through further. I can see how people would adopt this method because they have other things they want to focus on and get through. It's also an easier set of rules to live by, when you believe that there is a power above that will exact some kind of retribution or reward for abiding or breaking those rules. We are a results oriented species, in that we want to feel like we are being rewarded all of the time. We feel better when we have a sense of someone's approval for our actions. Hence things like the WWJD paraphernalia, which makes people think about how their particular God or Gods would react to their actions and act accordingly to get favour from that God or Gods under the premise of doing good, because then good will come to you. We can earn divine rewards simply by following the rules and being good to each other. That sounds fabulous.
Mike is right that it's also a sense of belonging to something, but in the bigger sense for some people, God is the ultimate parent and the ultimate giver and receiver of unconditional love. Everyone wants to be loved, so here is the ultimate power of love and if we just believe and abide, we can have that love not only in this life but in the next one or in heaven as well. And we even rationalize our temptation and sin by blaming it on an arch-enemy of our God or Gods, so that we can say that we were under the influence and were weak for a brief moment in time and make small reparations to our God or Gods to get back into favour. It is a lot easier than analyzing our actions and taking responsibility for our choices and actions in this life. No one likes to spend too much time in self-reflection because we don't like to examine our flaws too closely. Under a microscope, our intent could become clear and surely that would make our God love us less. And no one wants to feel like they are not loved, it's an awful feeling. I think that Jesus was a man, just as Buddha and Mohamed were men, and his intent in claiming that he was the son of God was to try and get people to realize that we are all the same and that a walking talking man, was no more a God than you or I. He has a lot to teach people, and he tried very hard to get people to love one another not because of God but because we were all in this together. It was the people of that time that deified him to the point of reverence, but I don't think that was his intent. Much like the Buddha and Mohamed, he did not intend to be worshiped as a God, only to enlighten people to the right path good or bad.
Religion is a trap not for the less intelligent, but for the weak willed. For those unwilling to spend the time to be better people just to make a better world. It becomes an addiction that is introduced and fed at a very young age to the masses in hopes that it will make people abide and feel loved. It works for a lot of people, and I would even argue that for those people, it's detrimental to their mental health and the safety of society in general. I think there is a reason that criminals in particular come to find God during their incarcerations. It helps them cope with the ills they have done, and allows them to bridge to a better life even if it is just faking it. Sometimes even allowing those people to replace their bad intent with the good intent of religion is beneficial to society as a whole. There are a lot of religious sects that have some very harmful ideas that effect not only their parishioners but others outside their religion. They vilify each other, and condemn each other in the ultimate show of hate fests built on shame and egregious oneupmanship. Through fear, and shame they keep people in line to receive God's ultimate unconditional love, and when they feel it... it feels like a million bucks. It's a good high for a lot of people. And even in some cases, it's not suggested that it be taken away.
A lot of people can't work through the idea of having good intent just because we should. That doing no harm to others begets no rewards at all. That there is no such reward as heaven and no influence of evil in their life that makes them do bad things. They just can't quantify it all, because it's too much work. Religion isn't a bad thing for some people who are weak willed, but it's definitely dwarfing to people with above average intelligence, it actually keeps them from understanding society and humanity as a whole. It continues to put people in neat little labeled boxes so they don't have to deal with the chaos that is reality.