Stupidity usually refers to a lack of intelligence. People may also act in stupid ways because they don't know better or just don't have good common sense. Comedy often uses stock characters, that are stupid; very often these are called fools or idiots.

An Allegory of Folly (early 16th century) by Quentin Matsys