You are confusing individual situations with population- based strategies.
Yes, one particular person can walk to work and still make poor lifestyle choices. However, if you make an environment in which active transport is appealing, then on average, the whole population gets more exercise.
Secondly, public transport makes cycling and walking more appealing because it cuts down on the number of cars on the road. People are more likely to cycle if they are not battling heavy traffic and cranky, frustrated drivers
I don't disagree, but no individual can change those things - it has to come from the government.
So, when posters come on here slating the people who genuinely have no other choice, they inevitably get peoples backs up. These threads always go the same way.
Yes, of course if we had better public transport then it would would be easier to cycle and walk places, but unfortunately that's not about to happen any time soon.
So for now, people are going to do what's quickest and cheapest for them - and for most, that means getting into a car and driving 🤷🏻♀️ criticising people who are only doing what they need to do to get to work and live their lives is never going to go down well!