When I was a boy (in junior & senior high schools), we were paddled naked by the PE coach in the boys' locker room (the girls were paddled in the girls' locker room). This discipline was very public within the locker rooms. It was considered to be a good deterrent for other boys and girls to witness the discipline that was received for misbehavior.
I can testify that more than half of the boys who I saw paddled, had erections (at least partial) before and/or during their punishments.
Some who had erections in the 7th grade (the first few times that they were punished in this manner), eventually outgrew this sexual arousal, but many did not. I was one of the boys who was always erect, and to this day I have never outgrown it.
I'm not sure about the girls, but I think that, for the boys, these locker room punishments actually helped us understand some things about our male sexuality. Of course, there were undoubtedly some homosexual or bisexual boys who received punishments in front of other boys, but most of the boys who got erections (became sexually aroused when Coach told them to fetch the paddle) were as “straight as an arrow". For example, I have never found myself the slightest bit sexually attracted to another man, but just the thought of receiving (and even giving) corporal punishments triggers sexual arousal for me. The straight boys learned that becoming physically/sexually aroused can happen sometimes for reasons other than desiring physical intimacy with a woman, and that didn't make us gay. The gay boys learned to co-exist with straight men (even in potentially homosexually charged situations), and have self-control over their sexual desires. Basically, we (as boys in the locker room) learned that it is not necessary to be too embarrassed nor hyper-focused on our human sexuality. We also learned that Coach didn't care whether-or-not boys had hard penises before/during their punishments, and we learned not to care either. It was simply his job to discipline us, if necessary. And, he made sure that boys would NOT want paddlings from him, even if the sexual arousal was sort of exciting for boys when they had to fetch the locker room paddle!