The idea of avoiding humor
All fanatics' negative claims concerning joy, laughter and humor are refuted by the Qur'an. Our Prophet (pbuh) and the Companions lived in a state of great happiness, in line with the spirit of the Qur'an.
It will be useful to touch on the prohibition of humor here. Successful humor is an art; people who achieve it are generally people who produce great works by combining art and intelligence. Humor sometimes brings joy to one’s surroundings. It can sometimes express criticism that cannot be made openly in a more covert but acceptable and conciliatory way. When employed in a way that bestows joy on the other party, that advises with sincerity but that also speaks to the heart, humor is a great blessing. Like all forms of art, humor is a blessing that expands people’s horizons and brings delicacy and subtlety to communities. Humor is also a fine aspect of democracies. Fanatics are led into a life with no delicacy; a crude and soulless life, by turning their backs on such a blessing.
Everything that the fanatics claim on the subject of joy, laughter and humor, as described above, is wholly refuted by the Qur’an. Our Prophet (pbuh) and his Companions lived in a manner compatible with this spirit of the Qur’an:
A'isha (ra) said that she accompanied the Prophet (pbuh) on a certain journey. The Prophet (pbuh) asked the people to move on, and they marched ahead. Then the Prophet (pbuh) said to her, "Come on, let us have a race." A'isha says that she ran and remained much ahead of him. The Prophet (pbuh) kept quiet for some time. … Again she accompanied the Prophet (pbuh) on some journey. The Prophet (pbuh) again asked the people to march ahead, and they moved ahead. Then the Prophet (pbuh) again asked her to have a race with him. This time the Prophet (pbuh) defeated her and she lagged behind. Now the Prophet (pbuh) laughed and said, "This is in reply to our previous defeat." (Ahmad, Safwat as-Safwah, vol. I, p. 68)
Abu Osama said he used to joke with him.
Abu Hurayra (ra) said, the Prophet (pbuh) would protrude his tongue to al-Husain ibn Ali who in turn would wriggle with joy when he saw it.
Abdullah bin Haris said that he had not seen anyone else who was more humorous than the Messenger of God (pbuh).
When some of his companions said to Prophet Muhammad (pbuh): "O Prophet Muhammad, you also joke with us!" He replied: "Yes, I do. But I only tell the truth." (at-Tirmidhi)
'Anas (ra) said that someone asked him if the Prophet (pbuh) made jovial remarks. Ibn 'Abbas replied in the affirmative. (Ibn Asakir and al Kanz Vol IV p. 43)
‘Anas (ra) said: “The Messenger of God (pbuh) was the nicest and the most humorous of people.”