High School cafeterias were often used as basic skills training programs for students (especially those with special needs) and profits went to subsidizing those programs as well as bringing in extra money for the school.
That said, if your goal is to make extra money for the school, you're going to sell what people are going to want to buy. Kids' tastes have changed quite recently, and they do tend to want healthier options, but you're still likely to sell more fries than crudité plates.
Soda bans and other initiatives shifted focus to requiring a more balanced and overall healthy menu, but it's also around the time that budgets really started getting cut. I could be wrong, but I believe now in Ontario we have sole-source contract with
Chartwells (Compass Group) for all institutions with production kitchens. Schools without dedicated kitchen facilities have other options, like their own snack programs or calling in places like
Real Food for Real Kids here in Toronto.
If you've ever been to a venue or attraction and it has a Pizza Pizza selling suspiciously small slices for absolutely insane prices, it's likely run by Chartwells (as Compass Group). They have a partnership with Pizza Pizza (among others), so outside of K-12 schools (where I believe they're restricted from doing so) they often pop one into whatever facility they're in. Pizza is cheap to produce with a larger profit margin than many other foods. So you get Pizza Pizza's barely edible pies made even worse!
Funny thing, even George Brown's Centre for Hospitality and Culinary Arts (AKA, culinary school)'s cafeteria is run by Chartwells, producing absolute institutional dreck. Makes sense, huh? It annoys the hell out of the instructors, but there's nothing they can do because it's the government's decision. The St. George campus is huge, and culinary school labour would be pretty much free as part of food production courses. Culinary students could easily produce better, cheaper food for the entire campus but can't.