"You probably know why you've been brought to detention today.
I've had multiple complaints from teachers: you masturbate in class. It's offensive, repulsive, and quite frankly, as your principal, I had higher expectations for you.
I understand you're going through puberty. You're probably getting surprise erections at all hours, and your hormones are making you very...""excited"". But this sort of behavior is absolutely unacceptable.
I see only one solution: to beat your balls until you are unable to have an erection all day. No more surprise boners for you! Welcome to ballbusting detention."