People can seem to be stupid if their reasons for action are not known.
People can't help but be stupid if deprived of factual information or if presented with false or confusing information.
Finally, all people are not trained to avail of the mental tools that civilization has honed over millennia to fight stupidity.
In the end "stupidity" is a social phenomenon, deeply connected to the nature of information exchange between individuals in society.
Transparency about the state of the world and the internal mental states of people and education (information processing capacity) can reduce what we commonly call stupidity.
But its a relative game. Full transparency and infinite processing capacity is not possible for human brains.