These are the classic words people use to deflect someone away from being mad, usually at some stupid stunt the speaker pulled. It implies that the person who is angry is simply being a poor sport. It is a perfect way to devalue their target and dismiss their being upset. In this way it is a perfect “you aren’t supposed to feel that” denial of the other person’s reaction. This is particularly nasty when one realizes that “can’t you take a joke” usually comes after a “prank” that is funny to the prank-er but painful/humiliating to the prank-ee. After all, that is the nature of pranks that quintessential “I get to laugh at you” form of humor.
People also use the phrase to get out of the consequences of saying something nasty about which the person was being perfectly serious but they now realize that the mood of the crow is not with them. In both cases, person A does something vicious to person B and then attempts to make Person B feel ashamed for their anger at being physically or verbally hurt. So yes, let’s add “can’t you take a joke?” to the list of Words To Watch Out For, our list of words to note and respond to as what they mean underneath the fluff and not just on the surface.