They haven't paid for it yet. Those items don't belong to them.
It makes their hands dirty, and because of that, it's gross. If they pay with cash, they're now transmitting their food dust and saliva to you. If it's messy food, now the cashier has to handle your filthy yogurt container, and now they have to find a way to clean their hands and whatever mess made by the guest. Sometimes the package gets destroyed after the guest ripped it open with their teeth and fat sausage fingers, thus making the barcode unscanable. Also, a lot of the time, people don't pay for the food. It gets abandoned on a shelf, or simply not paid for.
Also, where's the self control? If you don't eat those Cheetos right this very second, you will die? What fuck face adult can't feed themselves so they don't get to that point of hunger? Wait 10 minutes and pay for your shit first, rather than eating it and trying to pay at the same time like an irresponsible self entitled dipshit.