I used to throw freight for Walmart, quite a few years ago, and they threw away food as well. If a bag of candy got torn open during shipping or just wasn't sealed properly, they threw it out. It was explained to me that they made more money throwing it away and claiming it as a loss, than if they donated.