I would say that, generally, people come to SE (not just SE Mathematics) for answers to a particular problem that they need solving. These people are probably quite busy too. So they would want an answer without having to wade through inane comments that add nothing to the furtherance of their knowledge, or if they have asked the asked themselves, not to be notified of a comment, which they then have to take time out to read, that turns out to be pointless.
I personally find comments that add nothing to the answer to be noise and wish that I could get the time back that I have wasted reading it.
If I want to fritter away some precious time on humour, I will probably visit a joke web page or a forum on the web dedicated to such topics, rather than trawling through serious, heavy, SE subject matter, hoping for a joke or two.
If the question is jokey in nature then by all means add a humourous comment, as it is on-topic in that scenario. Indeed if one has been trawling through SE looking for a solution all day (or a couple of hours) then a jokey question can be a bit of nice relief, but as quid states in his answer: A joke here and there is alright.
Don't get me wrong, I am not a humourless chap, and I love messing about and winding people up. But as I approach 50 I realise that there is a time and a place. When people are trying to be serious, academic and/or professional, and I would say that SE is such a place, then that is neither the time nor the place.
Generally inane comments means the commenter is bored, and has nothing better to do. I know this well, as I used to work for a big company in my thirties, and was bored by the simplicity of the work there, and so, to amuse myself I would post what I thought was humourous comments to public support boards for resellers and users of the companies software. Then I would get slapped down for it, and I must be honest, I never understood why, and thought that my hierarchy of bosses were very boring and humourless. 15 years later, I know understand how irritating I must have been, and how immature I must have appeared. I ended up getting made redundant (after 12 years mind), and it was confirmed to me that my behaviour on the support forums had not helped.
This pro-, and contra-, joke thing is probably an age related issue, as the older you get the faster time goes and the more you realise how little time is left and you don't want to waste it.
Hope this doesn't come across as too harsh, it is just based on my personal experience at both ends of the wielded "joke stick".