So my point so far,
I think religious belief could be classified as a delusion, a belief in natural laws not supported by general experience seem to develop and be substained even in the absence of evidence supporting said statements and presence of evidence supporting other theories.
And while the non existence of a fact in an incompletly and imperfectly observed universe
cannot be proven, the claim that so called 'supernatural' events religious beliefs and superstitions are based upon are part of the natural/experienced and not purely the result of 'wishful thinking' to say the least haven't been supported by scientific evidence so far.
Past the passive support of the religious belief, there also seem to be a clear pattern of active denial concerning the implausibility or incongruence of different dogmas.
For example: Every religion I've heard of has a cosmogenic theory that seem to be extremely unlikely and generally use extreme complexity -gods etc.- to explain lesser complexity -Universe-.
The vision of the movement and nature of the planets and stars also never seemed to be the sort of answers an actual god like creature would have to know about[especially in habrahamic religions].
Actually, the theories were exactly those a human society would have developped at that period, yet, the knowledge is claimed to be of divine origin.
Now to continue with mental illnesses, what has often been noticed is that most mental illnesses seem to be coming from normal mechanisms of the brain that either run 'too slow' or are on overdrive.
OCD disfunction of behavioral positive reinforcement mechanism.
Excessive stress/phobia: disfunctional fight or flight response
...
I can complement that part if somebody feel it doesn't convey the idea. My point being that mental illnesses don't seem to be emergent new traits but rather malfunctioning characters or socially anormal traits.
Religion and the brain:
Apparently, Epilepsy of the temporal lobe can give people extreme religious experience, people would go as far as puting religion as a higher source of pleasure than sex.
By recreating artificially, using magnetic fields, this abnormal electric activity in the temporal lobe, michael persinger had 80% of the participants declare feeling an unobservable presence in the room with them.
There's a strong religious belief in the presence of a god, spirits, or ancesters that can be felt.
There are also plenty of studies explaining superstitions or OCDs using behavioral reinforcements. Example, chickens are left in a box and fed at random intervals, after a while, it'll happen that some chick gets fed after performing a particular action more than once and will start associating this action with feeding until the experimenters are left with a set of chicks each doing a specific action all the time because they came to associate those specific actions with 'getting fed'.
Brain and evolution:
So now one asks 'what if the answer is in 'who put god in our brain'.
Evolution theories seem self sufficient and the initial abiogenesis needed to start the whole process has been shown to be plausible in the primordial earth, such as the synthesis of amino acids and their assemblage into growingly complex constructs.
For more information
Abiogenesis - Wikipedia, the free encyclopedia
The god idea:
The issue here is always the same, introducing a god is equal to explaining what seems to be unlikely or complex with something EVEN more complex. Explaining the apparition of simple life by making an extremely unprobable god like conscience/intelligence create it isn't an answer, it just pushes back the 'origins' question one step backward and orders of magnitude further away in term of likelihood.