For perspective: I come from a country where “cafeteria” food at school is good and affordable (most is less than the equivalent of 5-10 USD max and it’s not slop, it’s actual food), but it’s not an obligation for everyone since it’s up to the student if they want to buy something or bring their own lunch.
The “cafeteria” in my school isn’t a typical American one, rather it’s closer to a canteen where they sell food you can purchase from cup noodles, fried stuff, sandwiches, baked goods, etc. also appliances like a kettle or microwave are available in the dining hall for students to heat up left overs if they wanted.
The thing I tend to notice from American schools (according to US movies, there’s bias whether it’s true or false) is that they tend to depict kids always heading for the cafeteria for recess or lunch picking up whats available instead of bringing their own food from home (left overs from dinner), why is that the case?
I don’t feel like the food I got in the cafeteria as a kid was slop, but there were definitely some dishes that did better when cooked en masse than others, and some that were more or less appealing. Like, pizza, ravioli, burgers, chicken sandwiches or nuggets, they all tended to be pretty consistent and good. The spaghetti tended toward being kind of weak and mushy because I imagine it’s tricky to get a proper al dente when you’re cooking for hundreds of people. Likewise, the baked chicken wasn’t anything to write home about.
Most of where they’d drop the ball was with texture or with things not being spiced as well as they could have been. But again, at scale I’m sure it’s tricky.
As others have said, though, the US is nowhere near as homogeneous as you’d assume if you only watch our media. A lot of the complaints about school food being inedible are also significantly overblown because it’s something to complain about and bond over.