I have just come off of Jinderella's post on a genetic basis of God-belief. I haven't read the book that she is referring to, but her post has added a new dimension to something I've already given some thought to.
I approached the discussion of religion from the evolution of the concept (meme) "Religion". I started with the rough observation that the regions where day-to-day survival was the most difficult tended to produce the religions that were the most restrictive of individual freedom and the more focused on afterlife reward/punishment. The primary survival advantage that humans have is our cooperative social structure. As the demands placed upon the tribe by the environment increase, the need for tight functioning as a group increases. Often times this would require some individuals to gain less than they might feel they deserve. To take what they want would be detrimental to the group. This is where I envision the meme "Sin" developing. The individual could be placated with the idea that small sacrifice now would be more than offset with a greater reward later, even if the reward is delayed until after death. Too much "Sin" could change the reward into punishment. Essentially this is the old argument that it is better to for go the small pleasure of sin now in favor of the bliss of heaven than to take the small pleasure now and face the eternal torment of hell.
If this process has been active long enough to register on the genetic evolution scale, then I could easily see that additional reinforcement in the genes is possible. Instinct, I believe, is an artifact of the reality producing functions of the brain.