The problem is that all school lunch food I've ever had is basically inedible. At least a vending machine used to provide me with something to keep my blood sugar from dropping.
Kids might be fat because they can't eat their school lunch, so they chow down when they get home. Then they pick at their supper, and eat late at night. Not eating all day at school sets up an unnatural eating cycle. Vending machines full of sugar aren't the answer, but I don't know what is.
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.