Healthy, inexpensive meals can take a lot of time to prepare. You could spend an hour making beans and rice, or you can take something labeled "Healthy!" out of the freezer and nuke it for two minutes.
A lot of the poorest people don't have time or energy for that. Even people with more money often think of themselves as time-starved. It would be better for their health and well-being to get around that, but it's hard to compete with the messages of fast food marketing. That marketing is often deliberately misleading with false "healthy" claims, and the food itself is incredibly easy to eat. They are fine-tuned to appeal to people, in part by packing in a ton of calories and excluding anything else that would dilute the flavors.
Combined with a ton of mixed messages and extraordinary amounts of wishful thinking, even people who should know better often don't put it into practice. And a lot of people genuinely don't have the time or energy to know better.
But for the millions living below the poverty line, having a place to safely store your groceries or a place to prepare/cook them is not at all guaranteed.
> you'll probably not be obese because you can't even afford food and you'll be rationing like crazy.
This is not how human physiology works at all. Mainly because our bodies won't let us get to that level of starvation voluntarily. We do have cheap shitty food for sale that can bail us out in times of hunger. This perpetuates a cycle of obesity.