Some airlines do ask travellers what they want to eat in advance. However it typically only occurs in premium cabins.
Singapore airlines has Book the Cook
Reserve your main course up to 24 hours before your flight from a wide
selection of meals, including creations inspired by our International
Culinary Panel. We offer 'Book the Cook' service in Suites, First
Class and Business Class. We also offer 'Premium Economy Book the
Cook' service in Premium Economy Class.
BA lets you choose your meal in advance in Premium Economy and above:
Choose your meal in advance
On selected flights you can choose your main meal from the on-board
menu between 30 days and 24 hours before your flight, for no extra
Economy passengers on BA can choose (and pay for of course!)
Order your main meal in advance
For more choice and peace of mind, you can choose and purchase your
in-flight meal from our exclusive online menu between 30 days and 24
hours before your flight. This meal option is available on many
flights departing from London Heathrow and includes drinks at no extra
If you choose not to order a meal online, we will offer you a
complimentary standard meal.
American airlines lets you pre-order in First or Business:
Reserve your entrée before you fly
Flying in First or Business Class? We’re the first U.S. airline to
offer you the choice to reserve your entrée on American Airlines
flights with scheduled meal service. To enjoy this personalized
service, simply reserve your meal at least 24 hours before departure.
Similar pre-ordering is available on other airlines for premium classes. For economy passengers I believe the way of avoiding wastage is to just restrict the last few rows to whatever is left over!
As pointed out in comments, you can order a special meal in advance which might help you get a choice that suits you, and if it doesn't at least you'll usually be served first...