I have tried, but failed, to understand what "wasn't professional" means. As far as I can tell, it is a synonym for "doesn't upset the status quo."
Clearly there are work meetings where this sort of joke/commentary would be voiced. For example, the writers' room at the various satirical news shows. There are, after all, professional comedians, including those which work blue.
I've heard people say that children in the workplace isn't professional. Then I think about professional teachers and pediatricians who have children at a workplace. As a child I sometimes went with my father to his job. I don't think he was considered unprofessional for that.
I've heard people say that drinking alcohol on the job isn't professional, and that one should follow a dress code. Then I see people on the job at a conference, drinking, and at one Python conference dressed up in unicorn costume.
It's therefore very context dependent, which is why I don't think "professional" is a useful way to think about the topic.
FWIW, I had a co-worker who was topless in shorts at the office. We were coming back from lunch in a downpour one summer. He wasn't prepared for it, his shirt was sopping wet, and keeping it on was a problem in the A/C'ed room. Having his shirt off wasn't a problem, and he wasn't considered unprofessional for doing so.
That's because it didn't upset the status quo.