I came across the following question on Quora, Is it bad to think people who believe in god are stupid?. I wrote what I thought was a good answer, though it hasn't gained as much traction as some of my other answers on the site. At any rate, below is my answer (slightly edited), which addresses not just why religious people have mistaken beliefs, but why all of us have mistaken beliefs.
Yes. It is bad to think that people who believe in gods are stupid.
People have all kinds of beliefs that they accepted at some time in their lives on the basis of authority and haven't gone back to re-examine. If they're in a culture that reinforces those beliefs or holds them up as virtues, it may be even harder for the person to examine them critically. And while having these kinds of un-examined beliefs may be bad, we all do it to some extent, so there's no reason to single out one particular kind of belief as marking that person as stupid.
Let's take a non-controversial bit of knowledge. Atoms are composed of subatomic particles, such as protons, neutrons, and electrons, some which are composed of even smaller particles. Most educated people know that, but most educated people accept it on the authority of science without understanding the evidence for how we know that. Maybe you happen to like physics so you actually do know that one, but how many people actually know and understand the evidence for how we know the earth revolves around the Sun, or understanding the structure of the Milky Way, or how to do isochron dating to know the ages of geologic layers, or understand aerodynamics well enough to explain how insects fly, or the evidence for why we believe Hannibal was a real historic figure, or actually understand evolution and the mechanisms behind it? Sure, if you're so inclined, you can delve into any particular subject to examine the evidence and theories and truly understand it. But the fact of the matter is that the totality of human knowledge is way too vast for any single person to apply that type of effort to everything. So, we learn what sources we can more or less trust, and tend to accept what we learn from those sources. Hopefully, it's not completely unquestioning acceptance. But I know that when I read articles in Encyclopedias, the claims go into my 'probably true until demonstrated false' mental bin instead of my 'probably false until demonstrated true' or 'grain of salt' mental bins.
Most people who believe in gods were raised that way. Almost from the time they could talk, they've heard claims from people they trust about the nature of gods and their religion - parents, relatives, friends, peers, etc. If their parents are even moderately devout, they'll probably get this reinforced every week when they go to church and hear these claims over and over from trusted priests, see an entire community of like minded believers, and quite possibly go to Sunday school to get detailed lessons from teachers. This is similar to the way children learn most everything, from formal education, to rules for sports and games, to unspoken rules of society. Why would we expect them to differentiate when it comes to this one particular topic?
Hopefully as people mature, they do develop critical thinking skills, and do re-examine many of their beliefs. But even that is a learned skill, not just 'intelligence'. Just like you wouldn't call someone stupid who couldn't do an indefinite integral if they'd never had a chance to study calculus, you shouldn't call someone stupid who doesn't practice critical thinking and skepticism if they've never been taught to think that way, or taught about all the cognitive biases that can affect what we think we know.
Plus, even for people who do learn those skills, it's awfully optimistic to expect them to apply that type of critical examination to everything they've been taught, for the simple fact I mentioned above, that there's just too much to know and not enough time to study it all in detail. And if they're still immersed in a community where everyone around them just 'knows' certain beliefs, it's going to be that much harder for them to question those beliefs, whether it's gods, urban legends, or popular misconceptions (like the common misapplication of Bernoulli's principle to describe airplane wings).
So, I guess the short answer is that people who believe in gods may be mistaken, but that's just one thing they're mistaken about, and we're all mistaken about plenty of things. And the way most religious people came to be mistaken about gods is the same way most of us have come to be mistaken about those other things. So, unless everybody who has mistaken beliefs is stupid (which would be pretty much everybody), there's no reason to single out the mistaken belief about gods as marking a person as stupid.
Note 1: Perhaps an easier way to answer this would have just been by example, as there are plenty of respected intelligent people who believe in gods - way too many to list. Since I personally have a keen amateur interest in evolutionary biology, I'll mention Ken Miller as an example of an intelligent evolutionary biologist who believes in a god. Note also (and perhaps obviously), that you can find plenty of respected intelligent people who don't believe in gods - also way too many to list. So, the examples show that intelligent people can have varying beliefs. I thought it would be more interesting to look at how people can come to have mistaken beliefs.
Note 2: Obviously from my answer, I'm an atheist and answering from the assumption that there are no gods. Of course, it's possible that's one of my mistaken beliefs about the world. But, given the number of mutually contradictory religions, the majority of people are necessarily wrong at least about the nature of gods. i.e. Even if the Hindus were right, it wouldn't be just us atheists who were wrong, but also the Christians, Muslims, Buddhists, and all the other non-Hindus.