That sounds abusive to me, and I'm Catholic, so technically masturbation is against our doctrine. However going to confession was nothing like that for us as teens and we were never punished by the church. To me that's the weird part, making a public example. That stuff was totally private for us. In fact I remember thinking our priest must have heard it all, because it seemed like he could hear anything in confession without expressing any shock whatsoever! I also remember in a group Q&A one time (in a very personal, small group retreat setting) a teen boy asking a priest how he kept from masturbating, and he replied that while those urges are normal and everyone has them, he redirects his mental and physical energies into other activities to combat it.
I mean people may think this is all extreme, but I'm just offering the perspective of a totally different approach to the same belief system. I guess just to say that there is another approach and that punishing and ridiculing is, IMO, abusive, even for those who subscribe to those beliefs.
I have to point out that in the LDS faith it's not about the church "punishing" you when you can't bless or pass the sacrament, go to the temple, etc. These things are extremely sacred to us and those who do it need to be in the right mental and spiritual frame of mind and have reverence towards that sacredness. It's not some reward for the good girls and boys and punishment for the baddies- it's a sacred obligation.