As I said above, it's possible to provide decent institutional meals; I know because our family has done it for Scout camp. However, there is still the problem of the children who refuse to eat anything but junk. There's very little a school (or camp) can do about that; it has to be dealt with by parents.
From what I hear from other parents, another problem is that the students aren't given adequate time to eat at the lunch period.
I don't believe that. Lunch periods are typically 20 mins. My sons, when younger, could wolf down foot long subs in less than 5.
Sugar is an acquired taste and often products with high sugar content also contain a high fat content. Kids crave sugar and get the fat as an added "bonus". Then when the sugar high wears off, they feel ravenous again and stuff down more sugary food.
Look at cultures which limit intake of sugar (Chinese, e.g.). They are not overweight.
Adults are the same--want something sweet as a snack or after meals. If you cut out sugar for a few weeks, you cease to crave it.