Identical twin studies show there is a strong inheritable component to religiosity.
Thomas Bouchard studied identical and fraternal twins raised apart and tested them on religious attitudes.
The correlation for the former turned out to be 62% compared to just 2% for the latter. His colleague. Kathryn Corson repeated the study with a different set of questions and got similar results - 69% for monozygotic twins raised apart and no correlation for dizygotic twins.
Similar huge differences were also found by large studies in Australia.
Which particular religion a person chooses is entirely environmental however.
McCourt, Bouchard, Lykken, Tellegen & Keyes 1999 cited in "Nature via Nurture" by Matt Ridley