You should pick up The Blank Slate by Pinker. Coming from a medical science background I'd hazard a guess that T.G.G. Moogly is pretty much on the money. I've studied the genetics of political affiliation much more than religion, but as a great example there are many solid studies which show that political affiliation is mostly genetic, not cultural. Our brain architecture predicts, to a very large degree, our eventual outlook on the world.
You can even move into aspects of our behaviour which are classically more benign than in hot button topics. Things like sexual desire. Is sexual desire something we learn, or an intrinsic response of our brain when we see objects of our attraction. Hint: it's the latter. We don't choose who we're attracted to, which foods we like to a very large degree, and a plethora of other things. I don't see why this would be any different for religious or political affiliation. And if you dive into the science this viewpoint is well evidenced.
Sadly, this also means that people aren't as plastic as we classically think they are. There is plasticity, but much of who we are and what we believe doesn't really change much across our lifetimes.
It's really interesting, isn't it, that given the vast differences among people wrt to their outward appearance we think their all the same where we cannot see. This must have to do with needing comfort and closure, even if it's a lie. It's as if some brains are sleep walking to a degree.
This is what The Blank Slate addresses. That we are all the same is a liberal idea purported before the rise of rigorous science to combat ideas of racism and genetic superiority after the age of Darwin. Honestly, fair enough, but in reality the idea is untrue, it's just a really nice idea that we like believing.
Parents think they can turn a fish into a monkey with the right care, Marxists think we can fundamentally change the structure of society if people are taught the right ideas, feminists attribute all of gender inequality to cultural influences. It's an idea that's extensive and pervasive, but like in most things we're usually reality averse. The idea gives us more substance than admitting it's not true.