They must've been waiting months for this. It sounds very premeditated.
You do not punish a kid for eating the wrong food if the kid doesn't know what's the alternative. It doesn't work that way, kids aren't seers, they can't guess what they were supposed to be eating instead. Since the kid was eating "unhealthy" food, then it is obvious that this kid doesn't know enough to make better choices. Why eat, how to eat and what to eat. Punishing a child who can't make a wise decision? That's why he isn't an adult, you know. This isn't education, it's called indoctrination.
But prohibition doesn't even work. It's the wrong message. The boy needs to be taught self-restraint, not have things outright forbidden from him. He must learn to choose and unless he wants to become a fat blob when he grows up he will choose better next time, though I defend his right to be a fat blob if so he desires as long as he stays clear of anything "public" and bears the responsibility of his decision. He can't be supervised everywhere he goes, he will stuff chocolate bars in his pants and eat them when nobody's watching, in the bathroom, haven't anyone thought of this?! Of course somebody did, so I suppose this is more about obedience than education.
Anyway More important than being able to choose "good" meals is being able to measure the size of your portions and eating just "enough" of whatever you're eating, that's the best way to start eating better. Sure you can have that box of Cheez-It for lunch if you can't help with it, but only 1/5 or 1/4 of the bag and granted you eat better in the following two meals, since you'll eat 5 or 6 times a day.
This kid will store his hunger and desire for "unhealthy" food inside himself and when he gets a window of opportunity to set it free he'll eat as he never ate before and stuff himself with more trash than if the school allowed him to have his small portions of tasty food, actually increasing the risk of diabetes.
Additionaly, some of us have tongues more sensitive than the rest of the people. We can feel the texture that you don't even know it's there, we can feel different tastes on the same food depending on which part of our tongue it touches. This makes us far more vulnerable to fats and high glycemic carbs because those taste better than anything else. It would be impossible to ban these from my diet, my desire for them would simply grow ever larger untill I couldn't control it anymore and had to have myself a 800kcal chocolate cake for lunch. How do I keep myself healthy then? Eating as best as I can during the week and giving myself more room to manouver during the weekend, without ever exaggerating. As you get used to more healthy meals than crappy ones you'll eventually realize that you can live with less carbs and lower levels of fat than you believe. And as you rake in the benefits of a healthy diet you will feel less attracted to bad foods and on the contrary start appreciating the healthy stuff. Alternatively, you can have a less healthy meal after every healthy meal you eat. Use your brain. Give yourself a completely free week to rest every now and then. How is this kid being taught any of this? How is he being taught to think for himself since he won't have people watching him all the time?
If this kid is one of us sensitive-tongued people, pitty to him. As if there weren't enough reasons for kids to stuff themselves with food, nobody who doesn't understand this will be able to help him.