St. Thomas had what you might call the classical distrust of laughter. When he wrote of mirth, he was as likely as not to have in mind "senseless mirth" (ineptam laetitiam), "which Gregory calls a daughter of gluttony." You don't have to follow St. Gregory's line of reasoning too closely to see that he didn't think much of senseless mirth.
But the "senseless" is a critical modifier. In traditional monastic thought**, laughter is a sign of suspended reason. When you're laughing, you aren't thinking. If you laugh a lot, then, you spend a lot of time not thinking, which is contrary to the religious life -- and, more generally, to our rational human nature.
It's senseless mirth, then, that is a daughter of gluttony, not mirth as such. In fact, that one reference to senseless mirth appears in the article, "Whether there can be sin in the excess of play?" (Hint: yes), which is followed by the article, "Whether there is a sin in lack of mirth?" (Hint: yes):
Now it is against reason for a man to be burdensome to others, by offering no pleasure to others, and by hindering their enjoyment... Now a man who is without mirth, not only is lacking in playful speech, but is also burdensome to others, since he is deaf to the moderate mirth of others. Consequently they are vicious, and are said to be boorish or rude, as the Philosopher states (Ethic. iv, 8).
He does go on to argue Aristotle's point that "lack of mirth is less sinful than excess thereof," but in the end he sees mirth as capable of being virtuous, when reason -- more precisely, temperance -- keeps it between two extremes.
It's also interesting (if you're the sort of person who finds it interesting) that St. Thomas mentions the human faculty of laughing twice when discussing the simplicity of God, then again when explaining that God is the efficient cause of all beings. When he wants an essential accident of man to contrast with the absence of essential accidents in God, or an example of something without which man cannot be, St. Thomas picks laughing. My guess (subject to correction) is that he got this example as a cliche from Aristotle, but it's still worth chewing over that to be human is to be able to laugh.