These monumental levels of waste occur for one reason - legal liability. Parasitic ambulance chasing Ralph Nader-fellating shysters and their sub-70 IQ vermin "clients" eagerly wait to crucify even the charities behind any business-approved food distribution activities. The sad fact is, grocery chains and distributors can be and are sued if it is found that they put forward insufficient effort to preclude the illicit removal of waste foodstuffs from their property (the legal analogy offered is not having a gate around the community pool).
As bad as it is now, it was worse before. Legal "food rescue" was an extremely risky (in the legal sense) proposition prior to the Emerson Good Samaritan Food Donation Act (1996). The cretinous parasitic trial lawyers fought that one tooth and nail ("to protect poor people from businesses looking to offload their disposal costs"), and have been chipping away ever since.