> Energy is definitely a better example than food.
All of these examples are irrelevant. Resource allocation happens because of scarcity, not alongside it.
> There is enough food produced to feed the entirety of humanity, probably several times over, but the social and political problem of who the food gets distributed to is the limiting factor, so hunger exists.
We theoretically produce enough calories to feed the entirety of humanity, but we do not come anywhere close to producing enough nutrients to feed the entirety of humanity. Calories are not sufficient to stave off hunger. One must also meet their nutrient needs to become "full". This is one of the reasons for why we see obesity: People continue to eat even after their caloric needs are met as nutrient deficiencies sees them continue to want to eat more to satisfy what is lacking.
However, even calories are only theoretically sufficient when you ignore the inefficiencies in the food supply system. Even if the social order was perfection, we don't have the technology or know-how to avoid those inefficiencies. It is, for now, a necessary part of the food supply chain.