Abu Hurairah رضي الله عنه used to joke a lot, whereas excessive joking affects dignity, and it is considered against good character (noble personality).
First Point
To label Sayyiduna Abu Hurairah as someone who jokes excessively is an outright lie and against the truth because there is not a single authentic narration or reference on this subject regarding Sayyiduna Abu Hurairah, nor has any historian made such a claim.
Rather, comprehensive books on the lives of the Companions, such as "Al-Isti'ab" by Ibn Abd al-Barr, and "Al-Asabah" by Hafiz Ibn Hajar, contain nothing of this sort, nor do reliable historical books like "Al-Bidaya wa al-Nihaya" by Hafiz Ibn Kathir contain anything of this nature.
Rather, it is mentioned in "Al-Asabah"
Reference: (13/56)
that a person came to Sayyiduna Abu Hurairah and said, "I was fasting, I went to my father who was eating something, he gave it to me, and I (by mistake) ate it." Sayyiduna Abu Hurairah said: Allah has fed you. Then he continued and said that he went to someone who was milking goats, he gave me milk, so I drank it. Sayyiduna Abu Hurairah said: Allah has given you to drink. Then he further said that he went home and slept, and after a while when he woke up, he drank water. Sayyiduna Abu Hurairah said: It seems you are not accustomed to fasting.Looking at the entire incident, the young man's continuous forgetting that he was fasting is nothing less than a joke, but in response, Sayyiduna Abu Hurairah did not mock him and kept saying very kindly that Allah has fed and given you drink, and in the end, he advised very nicely that you are not accustomed to fasting, meaning if you were accustomed, you would not forget repeatedly like this.
Hafiz Ibn Hajar also pointed to this excellent manner after narrating the incident.
Second Point
There can be two types of humor in religion:
◄ The one who jokes is obscene and causes harm to people; such a notion cannot even be imagined about Sayyiduna Abu Hurairah.
◄ A person who jokes should do so for cheerfulness, with the intention not to hurt anyone but to provide joy and refreshment. Such humor is considered a sign of good nature and is counted among good qualities. This type of humor cannot be criticized nor does it lead to any moral restrictions.
Imam Nawawi states: The kind of joking prohibited by Shariah is excessive joking, which leads to a habit of excessive laughter, hardening of the heart, neglect of the remembrance of Allah and other important religious matters, causes harm, and diminishes a person's dignity and respect. However, humor free from these issues is permissible, and the Prophet Muhammad ﷺ engaged in such humor. He ﷺ joked very little, and that too for some benefit or cheerfulness, and this is not forbidden but rather a recommended Sunnah.
Reference: (Kitab al-Adhkar by Nawawi, p. 326)
Third Point
The second type of humor mentioned in the previous point, just as it is not against seriousness, dignity, and justice, it is also not against Shariah; rather, this type of humor is legally permissible.