Schools should have the integrity to teach the kids what is healthy, unhealthy, etc. and how to moderate their intake of unhealthy foods - leading by example (offer 90% healthy, 10% unhealthy, or make unhealthy more expensive). Only feeding them healthy foods just makes them go home and eat junk food - because their "healthy" food is neither nutritious, filling, or has enough calories to satiate someone's need for energy.
This policy has an issue in its execution, not in its principle. Schools should sell only healthy foods. (I think we agree on that much.) The issue is that this policy defines "healthy" incorrectly. Whole milk is healthy. Whole grains are overrated.
No, we don't agree that schools should only sell healthy food - unless you're willing to accept that 95+% of foods are healthy in some way and in some quantity. Chocolate may not be healthy if your entire meal is made of chocolate - but in small quantities it certainly has health benefits. Same with caffeine. Same with sugars of various sources/types.
Schools are there to teach - not command, not force, not deny options. As with teaching other subjects, they should teach how to moderate your intake to a healthy diet - starting in elementary school (we used Go, Slow, and Whoa! foods as the model, and were taught that our plate should be mostly Go foods, Slow foods once or twice a week, and Whoa foods as a treat very infrequently). The school shouldn't be dictating what is/isn't healthy by virtue of only carrying certain foods - as you say, they will never be perfect at that. They should teach the children how to recognize healthy foods (not 1000 calories in one small square of food, high in vitamin content, not tons of fat calories, trans fats bad, etc), and then provide them with options for lunch.
Maybe the kid had a test first period that they thought they aced and they'd love to treat themselves to an ice cream sandwich for dessert at lunch that day. Maybe they want a nice greasy slice of pizza one day. They should be allowed to choose those items. Freedom of choice, but educate on the right choices.