Shelf space is valuable. Food that expires is inventory that’s not selling for some reason, or it wouldn’t be on the shelf long enough to expire. It’s taking up space that could instead be used for other inventory that does sell well. So even inventory that doesn’t expire at all will get put on the discount rack to get rid of it, or finally thrown out if doesn’t sell even at a cheap price.
The best way to avoid waste is to only buy food that actually sells, the quicker the better. Easier said than done, though.
Also, even greedy supermarket execs need to worry about their store’s reputation if they sell people food that doesn’t taste right too often.