"One should not be a person of levity and mockery ('s'chok v'hatail'), nor sad and somber, but cheeful ('samai'ach'). So too did the Sages say, 'Mockery and lightheadedness accustom [a person] to lewdness' (Pirkei Avos 3:17 - http://www.torah.org/learning/pirkei-avos/chapter3-17a.html). They likewise commanded that a person not be unrestrained in levity ('parutz (broken out) bi's'chok') nor sad and mournful. Rather he should receive all people with a cheerful countenance."
In the first chapter, the Rambam advised that we follow the middle path in life, that we not go to either extreme in most character traits. This week the Rambam writes likewise regarding a person's overall spirits.
The main excess the Rambam advises against this week is undue levity. The Hebrew term here -- s'chok (we'll use it below) -- implies more than just good humor. It firstly has a much more active connotation, implying rejoicing or merrymaking. It also often carries a negative connotation, conveying a sense of raucous and unbridled revelry. At the destruction of the First Temple, the Book of Lamentations (Eichah 1:7) describes our enemies as gloatingly celebrating (sachaku) our destruction. And after: "Your enemies opened their mouths on you, they hissed and gnashed their teeth; they said... 'This is the day we have hoped for...'" (2:16).
In the vernacular of the Sages (often slightly different from Biblical Hebrew), s'chok begins to assume even more negative overtones. It implies mockery and ridicule, reflecting an overall cynical view of life. It implies laughing and scoffing at everything, even that which must be taken seriously. The Mishna writes that one who instructs that a Get (bill of divorce) be written for his wife but does not instruct that it be delivered merely means to "play with" (l'sachaik) his wife -- i.e., to torment her, dangling an undelivered Get in front of her face (Gittin 6:6). Likewise, the Rambam above quoted the mishna in Pirkei Avos (3:17) that mockery leads to lewdness. Far from harmless joking around, s'chok implies making light of matters which must not be trifled with, of letting down one's guard and loosening one's morals to the extent that nothing is taken seriously and far worse breakdowns may follow.
S'chok is thus far worse than humor and laughter. It is not simply more of the same. It is a different animal altogether. I occasionally come across people who basically cannot be reasoned with. They find a springboard for humor in every topic. Attempt to engage them in serious conversation -- to have them think seriously about their beliefs and life values, and they laugh it off with some inappropriate wisecrack. Frankly, I have to hold myself back from wringing such people's necks. Without a doubt there is a time for humor. But some things in life simply have to be taken seriously. Humor as a defense mechanism -- as a means of blocking out all attempts at serious contemplation -- I find infuriating, and frankly, just not funny. For heaven's sake, at least take such matters *seriously* -- whichever side you decide to be on! I'd almost rather have someone tell me straight out he's not interested in G-d then have him sidestep the issue with some corny remark. In a way, I find the latter approach far more insidious -- for such a person refuses even to admit that the issue is worth contemplating. Laughing in the face of serious life issues will get you nowhere; such is a laugh hiding a crying soul.
In a different vein, it's interesting to note that the Sages generally have a positive view of humor. The Talmud writes that before the great sage Rabba began his lecture, he would crack a joke, the rabbis would laugh, and then he would sit down with awe and begin his lecture (Pesachim 117a). There's certainly a place in life for good Jewish humor. Even Torah study should be tempered with good cheer. We must study with an awe of the gravity of the subject matter being discussed -- in fact we should be terrified of misunderstanding or making light of G-d's word. Yet at the same time we should feel an intense joy at the opportunity to fathom G-d's Torah. And there's nothing like a little humor to bring out that warm, joyous feeling -- allowing us to loosen up and enjoy our studies.
My teacher R. Yaakov Weinberg of blessed memory once pointed out to me further that presumably Rabba cracked his joke in the study hall -- although the Talmud explicitly forbids levity and most non-sacred activities in a synagogue (Megillah 28a). Clearly, there is humor which detracts from the sanctity of a holy place, and there is humor which augments it, allowing us the proper frame of mind for meaningful and uplifting study.
Now and then I get a reader who complains to me that one of my occasional wisecracks in my class belittled the whole idea and detracted from the entire message. (I generally see that my wisecracks, poor as they are, generate much more feedback from my readers than my supposedly-serious teachings...) Needless to say, we must be careful that Torah study does not degenerate into a front for humor (or for that matter, marketing, brainwashing or any other less-than-sacred endeavor). Far too often I come across on-line Torah classes of the format "corny joke / cutesy story -- remotely-related lesson" (along with a corny-pun title to boot). Clearly, the Torah must not take back seat to some novice writer's attempts at entertainment.
However, as in many things, a proper balance can and should be struck. If the overall message is serious and worthy, there's nothing like a little humor to enhance it and bring it to life -- as well as affording a writer the opportunity to connect with a distant audience. For better or worse, our generation is far from the students of Rabba -- who had to be humored simply to loosen up and study without trepidation. Yet for us too humor has a place, allowing us the proper frame of mind for engaging yet focused study. To be sure, the Torah must assume primacy, but once established, humor can easily -- and naturally -- work its way in.