One rule which most try to follow is that you can make fun of people for their behavior, but not for things they can't help. This is just basic decency.
Thus, appearance, race, gender, and sexuality are off limits. But hypocrisy and the various other sins are not.
Some sins, such as gluttony, or vanity-resulting-in-plastic-surgery, both of which can result in changed appearances, occupy a gray area. But the basic division is one on which there is general agreement.
So where does that leave stupidity? Most of us, even if we would never make sport of someone's looks or sexuality, don't hesitate to mock stupidity.
We all enjoy laughing at those lists of incredibly dumb mistakes that students make, and don't feel the slightest guilt about doing so. Yet we call it a guilty pleasure when looking at, say, a National Enquirer article showing a series of photographs of stars with cellulite.
Yet neither of those are things which people can help.
Certainly no one hesitates to criticize bad character. But being able to camouflage bad character is often a matter of intelligence. A smart person is more aware of the image he is presenting, and will remember his own past behaviors better. And he will use his superior memory to guard against appearing hypocritical, even if he is a hypocrite. Likewise, a smart criminal is more likely to get away with his crimes. So when we criticize bad behavior, at a certain level we're actually criticizing stupidity as well as character.
Yet intelligence is something that we are essentially born with. Without getting into an extended discussion of the nature/nurture argument regarding IQ, the fact is, it's basically something we can't help.
So maybe stupidity is something we shouldn't make fun of.
Nah. It's too much fun to do so.
(Full disclosure: the author is not quite as observant of the above rules of etiquette in person as he pretends to be on this blog.)