YES (but).
The best answer so far (to this Quora question) has been suppressed (perhaps by a downvote), but here’s my version.
The “wiring” is not for religion per se (and certainly not for any particular version), but religious beliefs of various kinds are a frequent consequence of a couple of features of the human brain that have clear survival value and so have been subject to enhancement by natural selection.
One, which has been noted in many answers, is a tendency to attribute agency to any observed phenomenon. The survival cost of wrongly ignoring the sound of rustling leaves is much greater than that of wrongly imagining that it might be caused by a predator. So it is not surprising that we are liable to wrongly imagine that the rising sun also is caused by the will of some conscious agent.
Another, which has been mentioned less frequently in the answers and is admittedly a bit controversial(*) among evolutionary theorists, is our tendency to band together in competing groups of not necessarily related individuals and to identify allies and enemies by shared features that may go beyond what we inherit as individuals – such as for example bodily decorations by paint, tattoo, uniforms, gang or team colours, etc. as well as ritual behaviours and profession of shared “beliefs” (with silly and irrational ones perhaps being even more effective at indicating mutual loyalty).
A third, which may be just an extension of the second, is our propensity to suppress our own judgement and follow designated group leaders, not just by force of direct dominance but also via the delegated authority of intermediaries – which I suspect may have been what gave the modern “Cro Magnon(?)” humans an advantage over the possibly bigger-brained Neanderthals by enabling the cohesion of bigger tribal groups.
(*) – As an addendum I would note that the controversy among evolutionary theorists is with regard to the existence and importance of “group selection”, and that I do indeed have a definite opinion on this.