your friend was caught & deserved to be punished

the meaning:

Your friend’s bad behavior is catching up with him or her, and now other people know the truth, too. Ask if you can help your friend with his or her problems.