Be deserved under the circumstances. For example, That punishment serves him right after what he's done to you. It is also put as serves you right, as in It wasn't accepted? Serves you right for applying so late. These idioms use serve in the sense of “treat in a specified manner,” in this case, justly. [Late 1500s]
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.