There’s a world of difference between real humor and cocky snarkiness. I think C. S. Lewis caught that distinction well in The Screwtape Letters as senior devil Screwtape instructs junior devil Wormwood on how to twist the character of the human he is trying to drag into hell:
Flippancy is the best of all. In the first place it is very economical. Only a clever human can make a real Joke about virtue, or indeed about anything else; any of them can be trained to talk as if virtue were funny.
Among flippant people the Joke is always assumed to have been made. No one actually makes it; but every serious subject is discussed in a manner which implies that they have already found a ridiculous side to it.
If prolonged, the habit of Flippancy builds up around a man the finest armour plating against the Enemy that I know, and it is quite free from the dangers inherent in the other sources of laughter.
It is a thousand miles away from joy; it deadens, instead of sharpening, the intellect; and it excites no affection between those who practise it.
We are surrounded by flippancy in our society, but genuine humor seems to be in short supply. There’s nothing wrong with humor; in fact, God created it. We just need to be sure our humor isn’t tinged with the sad trait Lewis describes here.