Right, so then the most optimal outcome is always buying food even if you don't need it, and perhaps even throwing the food away immediately. If your total comes out 22.00, then go ahead and buy 6 ranch dips and bring it up to 25.00.
Now, it's not stealing. Does this outcome feel more morally correct to you? I think, if you answer "no", then your logic on how this stealing works is faulty.