The fact that a reprimand can be a punishment certainly has the relatively plain "let you find out what's bad about yourself" part of it, but it's also saying, "I know you won't accept this, but you still have self-contradiction, so you're going to feel bad about it, and I'm going to use that to punish you, and I'm even going to use your feelings of anger and rebellion to punish you. Make you feel annoyed due to your anger and rebellion against me as a punishment." From punishing one's rebellion in order to avoid one feeling rebellious, to using one's rebellion as a punishment for him.