vicarious punishment

Noun

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