It is another case of having a problem and finding a quick easy solution (maybe) and ignoring whether it is the right thing to do. A case of, "Fixed my problem, why care about the unconsidered side effects ?".
I tend to dislike banning things as a general rule, although there are some cases where it seems the best solution. Heer the issue is with the life choices made by the pupils and the ability of their parents to ensure they choose the right thing. I do not believe Big Brother should be interfering in people's lives like that, whether it is for their own good or not. If a mayor wishes to do something, how about a school leaflet drop explaining why school dinners, or going home to a healthy lunch provided by the parents, is best ? Advice is fine. Arguably a waste of ratepayers' money, but fine in that it isn't interfering where it ought not.