When A is making fun of B in front of everyone, and C, who's B's friend says "Hey, go pull the legs off a spider.", to A, C is telling A to find something better to do with their time than to make fun and laugh at C.
B is the one being laughed at by A.
C, in saying this to A, is doing several things at the same time.
Showing strong support for B.
Showing clearly that A's laughter is entirely inappropriate.
Also saying that A is the type of person who'd enjoy ruthlessly pulling the legs off a spider, is not only a bully but also acts like a child.
"Hey Dave are you a total fag or something?", said Dan, as everyone in the room was laughing at Dave, including Dan. Then Dale, sticking up for Dave, said to Dan, "Hey, go pull the legs off a spider." Then Dan felling small and belittled stopped making fun of Dave.