Vicarious Punishment Definition

noun

The punishment of somebody who has committed a certain act, in order to dissuade others from doing the same.

Wiktionary