it serves someone right

serve (one) right

To be or deliver the appropriate or deserved consequence(s) for one's improper actions. It serves John right that Dave threw him out of his party last night. He was acting like such a jerk! My girlfriend broke up with me after she found out I had been cheating on her. Serves me right, I suppose. You tripped while making fun of those kids? Serves you right!
See also: right, serve
Farlex Dictionary of Idioms.

it serves someone right

or

serves someone right

COMMON If you say it serves someone right or serves someone right when something unpleasant happens to them, you mean that it is their own fault and you have no sympathy for them. Matt Walker has retired early from his day's surfing with a broken board. It serves him right, he says, for trying to surf bad water. Serves her right for being so stubborn.
See also: right, serve, someone
Collins COBUILD Idioms Dictionary, 3rd ed.
See also:
  • serve (one) right
  • serve one right
  • serve right
  • serve somebody right
  • serve someone right
  • serving
  • give (one) a pass
  • big break
  • in consequence of (something)
  • once too often