A good example of this would be smoking, you know it's bad for you, we all do, it's an expensive habit and it's something people from poverty are more likely to do. Why you ask? Because they use it to keep going, it's a stimulant, it gives and extra bit of energy to keep going, to keep working those multiple shitty jobs with shifting hours, small breaks and soul crushing atmospheres.
It's hard to think about the future when you are being crushed by the present reality.
It's much the same with junk food. When time is the thing you don't have and money is the second thing you don't have. Cooking food, especially prep heavy food like beans that have to be soaked overnight, then boiled the next day, then if it's a large enough batch (which it would have to be for efficiency) you have to place it in containers, portion it out etc. We are talking about hours in a day that you don't have (made worse if you are raising a family, working two jobs, taking care of extended family, as many of the poor do). So instead you buy a hotdog from a 7-11 or a shitty vending machine hamburger at work. Life gets worse, seems like there is no hope of it getting better until eventually that little bit of you food you enjoy is about the only part of your life you enjoy, because what else is there.
It actually almost makes sense in a way since you are getting the most calorie bang for you buck, and when that dollar has to go really far, and you aren't sure if food will run out later, the quick math that supports the immediate future over the long term one is what wins out.
I'll never understand the cruelty of trying to place the blame of systemic problems on those effected by it.