Evolution is a blind tinkerer, lacking the foresight of human engineers. Rarely, if ever, does it discard established designs and start over fresh, even when that would be more efficient. Instead, it builds on and around past adaptations, using the old as a foundation for the new. This is true throughout the biosphere, and it’s especially true of one of the most complex structures ever evolved, the human brain. The physical architecture of the mind shows, through and through, the evolutionary hacks and kludges that went into creating it.

In his book The Dragons of Eden, Carl Sagan points out that the human brain has a threefold division. The most complex and most recently evolved structure is the neocortex, responsible for rational judgment, self-control, long-term planning, and all those other characteristics we think of as most uniquely human. Below it, somewhat older, is the limbic system: shared by all mammals, producing feelings of parental love and pair-bonding. And oldest and most primitive, shared by all vertebrates, is the brainstem, which controls the instinctive drives and behaviors known as the four “F”‘s – fight, flight, feeding, and reproduction.

And if you’re feeling allegorical, you might notice a correspondence with the world’s religions. No organized religion in existence today posits a god of the neocortex. A few of the best offer a god of the mammalian brain, but even they rarely aspire to anything higher. But most – the belligerent, aggrieved, crudely literal fundamentalist faiths that command the allegiance of hundreds of millions – have gods of the reptile brain. These deities well up from the brainstem, the evolutionary remnant that sees the world as a dark palette of anger, fear, hunger and lust. Like the promptings of the brainstem, they’re concerned, more than anything else, with the lowest and most primitive animal drives: what we eat, how and with whom we have sex, whether we observe rituals and taboos relating to purity and contamination. Also like the promptings of the brainstem, the religions they preside over tend to include generous amounts of aggression, submission, and xenophobia, and inflexible rules on when these are to be displayed and toward whom.

Of course, I’m not saying that religion originates solely in the brainstem. Were that the case, we’d see distinctly religious behavior throughout the animal kingdom, which we obviously don’t. Religion requires other mental capabilities that are largely unique to humans and other intelligent mammals – social dominance hierarchies, pattern-seeking behavior, and an awareness of personal mortality. Still, it’s striking how close is the correspondence between the concerns of fundamentalist religion and the instinctive drives mediated by the most evolutionarily primitive part of our brains.

But from the rational perspective – the highest, most uniquely human perspective – it’s clear how ridiculous and morally outrageous this is. The fundamentalists believe in a supreme, universe-transcending creator whose single-minded, all-consuming focus is what people do with their genitals – a clownish, laughable notion deserving only ridicule. But even worse is the notion, held by millions of believers, that this being threatens humans: “Obey me or I’ll hurt you!” This idea is a moral depravity that could only be born from wicked minds.

Any god worthy of the name wouldn’t coerce its creatures’ obedience through fear or pain, but would set up the world so that they would all freely choose through reason to do the right thing. That would be how a supreme intelligence would create; that would be a god of the neocortex. Instead, the religions of this world are stocked with clumsy, brawling, belligerent gods of the reptile brain – gods who are constantly bewildered and enraged when their plans go astray and who can think of no better tools than violence and destruction.

Religion is supposed to bring out the best in us, we’re told by its defenders; it’s supposed to encourage the decency and compassion that human beings are capable of. And perhaps, sometimes, it does do this. But more often, it gives vent to the violent, destructive side of our nature, gives us license to express our xenophobia and violence and rage under the illusion that these qualities are endorsed by God.