I think the solution is simple: make a rule. Clearly define what is and is not acceptable behavior. Then, if, in the judgment of the umpire, a player has acted in an unsportsmanlike manner, they should receive something akin to a technical foul. Maybe they get tossed from the game or fined or something. The other team should not be the arbiter and the punishment should not be a projectile hurled at them. That’s like if, instead of a free throw, in basketball the other team got to whip the ball at a guy. It’s barbaric.