Water is a human right, and there is a somewhat vague statement that, if you have access to a tap and someone asks you for drinking water you have to give it.
At least here in the US, there's a fair bit of public infrastructure around water being a human right. Every establishment you walk into likely has a publicly-accessible fountain.
I imagine something similar would have to happen around food, and I don't think it would be that hard in practice. All we'd have to do is make it illegal for food vendors to trash edible food at the end of the day, but it'll never ever happen. We care more about the civic religion of capitalism than we do about people being able to eat.