It's crazy when you think about the whole supply chain: preparing the soil, ploughing, applying fertilisers, applying pesticides, harvesting, processing, transporting, and then you just chuck it out and each step of production had its footprint.
It's why expiration dates must be updated to reflect real expiration dates, not "best by". We toss large amounts of food because of that. Probably large amounts of restaurant waste, too.
I think it's more of the expiration date should be more explicitly a suggestion and a limit for the retailers. People think after the best by date it's no longer good, when in reality it literally means what's written: better before, not bad after. I'd say it's a wording thing first, because using an actual expiration date is impossible, and would open food producer to petty lawsuits about the product being not good 1 day before the estimated date
My grocery started a campaign where the "guarantee your milk has at least 10 days," so they're discarding or diverting milk not just on the 'best by' date, but 10 days before that. All I can hope is that it's getting diverted to lower-cost stores or food banks and not actually getting thrown out, because that's ridiculous.