The problem with religion is the same problem that exists with any system (like politics) in which ideology motivates human behavior. The problem is us. Divine spark notwithstanding, humanity is a mess of conflicting values, needs, and desires.
Do you need to feel you belong, that you are part of a community? Do you seek to transcend the daily grind of economic and social survival? Do you need to find hope that the future of the world is better than the brutal violence, spite and indifference to suffering we today? Do you personally need to find comfort,strength and meaning in light of your own difficulties? Do you want forgiveness, a clean slate, a new beginning? Organized religion has a lot to offer you along these lines. Do you need to feel better than somebody else? Do you need to feel important? Do you want to belong to a club where you can get closer to people’s money and children? Do you want scriptural justification for hating a particular group of people, even though the number one and two commandments are Love God and Love others, no exceptions? Unfortunately, you can also find those kinds of opportunities in religion as well.
I think the purpose of religion is to provide a structure to help people grow closer to God. Some would say that is unnecessary, that the problems of organized religion outweigh its value and anyone who wants to seek God can do it on the golf course, the hiking trail or in their own home. I reply that you can grow closer to God through private meditation and study, but ultimately seeking God by yourself is looking for God in the mirror, and that will only take you so far. Faith communities give people a chance to share their various experiences and beliefs, for even within a single community there are as many underlying ideologies as there are people. Everyone experiences and understands God in their own way, and in a living faith understanding grows and changes over time (note I didn’t say God changes.) As messy as we are, with our conflicting values, needs and desires, we can help each other grow and support each other through difficulties. Together, when humanly possible.