you taught someone a lesson

the meaning:

You are a good person, who is upset by criminal acts and wrongdoing. If you saw someone misbehave recently, tell them to straighten up and do the right thing.