I believe there is an evolutionary purpose to human stupidity though, and it's the reason we've come so far as a species. Without writing a novel here, look up the concept of simulated annealing, which is conceptually related to natural selection. The short version is, when searching for a better solution to problem in a sea of functionally infinite possible solutions, if you only ever try solutions you can see that are categorically better than the solution you currently have, you will (with statistical certainty) end up in a local maxima. That is to say, without stupid people, no one would have ever looked at a cow udder and thought, "yeah, I wanna get in on that", and as a result many humans throughout history would have gone without nutrients necessary for their survival.
I have no idea who first drank cow's milk, that's not the point, don't @ me. The point is, stupid people try stupid stuff, many times it is just as stupid as it looked, but sometimes that stupid thing turns out to have previously undiscovered potential benefits which smart people notice, research, and help integrate into our society, resulting in others' lives being better.