If it regards a person's medical issues, it is necessary for schools to decide whether a certain medication should be held for said child. Also, if the school finds it necessary to call an ambulance for a student when needed, it can save a person's life, instead of having to get direct consent from a parent or a higher position of the school.
There were always school nurses and periodic health checks, even fifty years ago. Now we know more and we must do more. That does not mean that a school needs to forbid everything or turn into a health clinic. But serving foods that are unhealthy or selling them in vending machines is just too much temptation for children.