People who are saying healthy food is cheap, sure some healthy food is but generally nice healthy food is more expensive.
Overweight people still eat fruit and vegetables, but let's be honest bananas, carrots are pretty dull to eat all the time. We can't survive off brocoli alone. It's the things with the vegetables that cost
My thin rich friends will eat for example a tuna steak with salad, breakfast is berries etc. All delicious, satisfying food. But expensive.
There are vegetable that are cheap but it's pretty soul destroying to just eat veg. No one I know who is slim will just eat veg.
I come from a working/lower middle class background and I am now in a more upper middle class profession, where the majority of people are slim. If I go out for brunch with work friends literally everyone will have something healthy like granola or avocado on toast. If I go out with home friends people will have fry ups, some will have healthy but not everyone. With the first group their is the peer pressure to eat healthy food, with the second there isn't. They also all do gym exercise daily.
It's also about the jobs people do, better paid jobs although stressful I think are generally more satisfying. Lower paid jobs are more drudgery, less satisfying. People are more bored and are less likely to want to eat healthy or go to the gym.
People with money have time to pay for childcare, but also activities so more variety and less boredom. They have more money for treats, so if you only have £5 for a treat then you might buy a slice of cake or a McDonald's, if you have £100 you might get a haircut or a pair of shoes.
People who go out to eat for a treat are more likely to chose something unhealthy, because they want to make it worth it. Whilst people who eat out all the time might have something healthier, because they eat out all the time. Also cheap restaurants tend to be less healthy.
It's also a self forfilling thing, if you are slim you will get used to eating less so eat less.
There is a correlation between weight and class, you can't pretend their isn't. That doesn't mean if you are poor/working class you will be overweight but you are more likely to be.