It's usually claimed that some people eat junk food because they can't afford healthy food and therefore become overweight. These claims are often based on price comparisons where calories per dollar is used and includes junk food, vegetables and staples.
I don't think cost per calorie is a good measure of how affordable food is because it doesn't take over-consumption into account. There is a whole range of costs related to being over-weight, but the problem is not only linked to long-term costs - the whole comparison is flawed. Obviously, junk food is rich in calories so it's natural for the price to be lower per calories. And obviously, overweight people consume too many calories. I think a logical conclusion to draw is that junk food makes many people fat because it's easy to exceed your recommended calorie intake. So if junk food makes you eat more calories than you should whereas a healthy diet would make you eat less the price comparison can only be between meals, not cost per calories.
And comparing burgers with fruit isn't a good way to go either because eating fruit loaded with fruit sugar doesn't necessarily mean you're healthy.
It's like all those 3 for 2 offers in the supermarket. It's cheaper so you buy more. Then you don't have time to eat it before it goes bad so you throw it away (food waste in the U.S. is 50%). Food producers and supermarkets are profit-making companies. They're not giving anything away for free so most definitely these discounts have already been included in the original price. Which means you pay too much for food you are going to throw away. That's bad enough, but the problem about over-consuming junk food is that you don't throw it away once it goes bad, it stays in the body and it leads to overweight.