If God made genes, then there is not reason to believe he would not have inserted a God gene. More specifically it is clear that most every culture has some semblance of religious ritual in it (theistic or otherwise). It is so universal a human trait that one can well imagine it being at least somewhat hardwired into us. (That said, there is a vague--but I think incorrect--sense we all have that our minds exist separately from our bodies. I think that is the root of why it's easy to feel that any genetic influence on our minds is in a sense "tampering.")
It makes sense that primitive societies could have been benefitted by such a religiuous sense, as it would have promoted intra-group cohesion to have had a common set of religious prescriptions. Better, the belief in a religion can direct individuals to stay within the rules agreed to by the group in situations where no other group member could deterct a breach. (Because the spirits or Jesus or whomever would know that you violated the rules.)
There is the old question about whether natural selection can favor such rules on the level of a group, rather than purely based on the individual, but it is hard to see how most any "social" trait of a social species like mankind could develop if natural selsection could not select for enhanced group dynamics.
In general I have to agree though that natural selection is not working "against" atheism. It has selected for religiosity in the past, imo, because of the social benefits that common social and ethical norms instill within a group. In a religious society, atheists are the ones who reject at least some of those norms. As natural selection starts favoring the religious types, they start ostracising the non-religious ones for that failure to conform, and the process accelerates.
The more interesting question for me, if whether religiosity has started to be maladaptive in the post-hunter/gatherer world that we now live in. In early human societies, we had small leaderless groups. Agriculture brought permanent settlements and hierarchical social controls...and religion was co-opted by the leaders within that hierarchy. It's at that time also that we start to see more clear signs of theism. Prior to then there were certainly religious sites, but less evidence that there were hierarchies of celestial power with some spirits being the boss of others.