Tradition plays an important role. Most people invariably choose the religion of their parents. It's also part of the group oriented social control mechanism of organized societies. Hammurabi law to the Koran all dictate and instruct specifics of living one's life based on group dynamics codified in dogma, religious rites and colorful rhetoric open to so much interpretation.
For control it serves it's purpose to teach obedience, unquestioning loyalty and the most dangerous aspect lies in the ability to stem rational, logical and critical thinking as discourse for determining the truth. If you are taught to never ask or question authority or what someone else interprets as the "word" or the "way" then that truth is only a reflection of another will upon your own. This is why religion is often useful as Seneca stated:
Religion is regarded by the common people as true, by the wise as false, and by the rulers as useful.
(Roman philosopher, mid-1st century AD)