I'm a chef instructor at a rural high school. I don't entirely agree with your answer. The production of decent cafeteria food was really hurt by the Healthy Hunger Free Kids Act which mandated low sodium, whole grain, no frying, and the use of lots of fruits and vegetables. Any school that expects to receive Federal funding for free or reduced school lunches must abide by Federal requirements.School cafeterias usually gravitate to what the majority of kids will eat. Remember OBama's wife and her campaign to bring healthy foods to school cafeterias? Most kids wouldn't eat anything and the food would up in the garbage- as did her school lunch program.
It doesn't help that school cafeteria workers are among the lowest paid members of the food service industry. Although school cafeterias COULD make everything from scratch, many simply don't have sufficient trained personnel to do so. Even if these cafeterias had sufficient cooks, the average budget per meal is $2.93 and the meal must meet Federal nutritional guidelines under the Healthy Hunger Free Kids Act.
To be candid, it's a lot easier for most cafeteria managers to just buy processed heat and serve foods. This worked out great for me at another school because they surplussed a stand mixer which I picked up for my Culinary Arts kitchen.
You are right regarding the amount of wastage. The food is bland and boring and kids who are reasonably affluent either go off campus to eat (provided this is allowed at their school) or they bring sack lunches from home.
Kids who eat school lunches are often forced to take fruits and vegetables that they don't want because if the cafeteria can document that these foods are being served, they get more money from the Feds. The Feds apparently don't care whether or not anyone actually EATS the fruits and vegetables that are being passed out ... and quite frankly I've been appalled to see perfectly good grapes, apple slices, and other items being tossed out.
Although the Federal legislation regarding school lunches was well intended, like all too many Federal programs, the Healthy Hunger Free Kids Act has had unintended consequences.
I personally think that the government has no business mandating healthy meals. Low income students were much better off when they were served food that they would actually eat.