It is not entirely clear whether you are talking about food provided by schools through tuck-shops and the school meals service or about items children bring to school with them.
If the former, then obviously the provider is in a position to determine what is and is not available, a point which was made evident when many local education authorities withdrew beef fro menus, following the CJD scare.
If the latter, then safety and common sense should restrict what pupils bring in. For example, many schools will not allow drinks in glass bottles. Alcoholic beverages would certainly be banned. But it would be a brave school which tried to control the contents of lunch-boxes. Quite apart from the parental anger that would surely be aroused, the problem of checking would be an unwelcome task. And what do you do with the miscreant who has smuggled a Mars bar on to the premises?
I am inclined to think that while schools have a duty to educate pupils about healthy living, they have enough to do without taking over the parental responsibility to control their diet.