The context here is that a woman can't threaten a man with violence due to being unable to injure or harm the man (I'm excluding stinging for a few seconds from a slap).
Whereas a woman is always at a great disadvantage for defending herself against a man, so if a man hits her, even if it's just a slap, it indicates that he is willing to hit her, and might hit her harder next time causing damage. This context makes the difference between a woman slapping a man versus a man slapping a woman. A similar situation is if a very small child slapped an adult.
Note that my statement isn't comparing women to small children, but to illustrate the role of differences in displays of physical power between two people.
None of the above is me endorsing any sort of violence or physical retribution, but I'm trying to explain most people wouldn't be okay with a woman hitting a man in a way that injures him or causes long term intimidation, but why a slap in a sitcom is accepted.