I work for an airline, and let me share another perspective.
It is often said that airlines are "greedy" people. Well, we are not more greedy than any other business, so we are just average people really. But there are limitations on what we can put on a passenger's meal: namely weight and space.
Both weight and space are precious on a commercial aircraft, as you probably already know. The cart holding meals is actually surprisingly small; barely one feet across and waist high. You can put everyone's meal in a small kitchen in one of those tiny apartments in busy cities.
So there is a limitation on how big the plastic tray is. That, in turn, limits the amount of food on the tray. More over, not every kind of food can be served mid-air. Freshly cooked food such as fried chicken are out of the question, for example. The food also has to be "not messy" when eaten, and acceptable to a wide variety of passengers from different cultures and different diets.
Most aircraft fly return routes, i.e. they depart from the main hub, land at a destination, then turn around and land at the main hub again. That's two flights. Depending on the airline, the route and the food served, the meals for the return trip are actually loaded at the main hub. This wouldn't apply if it is a 13-hour long trip for example, but it may well be the case for short trips.
The catering companies charge us by food cart. Sometimes there would be the dilemma when the number of meals is just over our capacity, but we do not what to hire an additional cart. It is either a cart used to its maximum, or no cart at all. And of course that cart has to go to some slot in the gallery.
Business and First Class passengers typically would not have this problem because, well, you paid for it (-: