Sorrow is better than laughter: for by the sadness of the countenance the heart is made better. Ecclesiastes 7:3 (KJV)
The word for ‘sorrow’ is derived from ka‛as כַּעַס, and it means ‘vexation, or anger.’ (H3708)[1] Here, anger is positioned in the context of our sinful existence, and God’s divine disapproval of it. (Provan, 161) In such a case, vexation of spirit is better. It reflects the sort of wisdom that invokes the understanding of the desperate state of the spiritual life. Laughter only deepens the vanity of life; it contributes to the enigma that humans are already entrenched in.
Reference:
Provan, I. (2001). Ecclesiastes/Song of Songs: The New Application Commentary, Zondervan
[1] https://www.blueletterbible.org/lexicon/h3708/kjv/wlc/0-1/