It's interesting that overall spending doesn't decrease that much in the end, although shifting from snacks to fruit is the kind of change health advocates have always wanted?
GLP-1 helped me kick my cravings for junk food, but that just meant I was eating more of the "expensive" stuff. Instead of $0.50 worth of Doritos as a snack, I'm eating $1.50 worth of Greek yogurt and $1.50 worth of fruit.
More than a billion asians eat nutritious, cheap and calorie-balanced meals every day, unprocessed.
Staples like legumes and rice don't cost much and are very nutritious. And supplementing with moderate amounts of seasonal fruits and vegetables and moderate animal protein is still very affordable and healthy.
A kilo of (dry) legumes is about $3.50, about 3500 calories (50% more than an average human needs per day), delivers >200 grams of protein, > 100 grams of fiber, some healthy fats and enough carbs to power you and a good set of vitamins.
Hell if you get down to it, vitamin pills to supplement any deficiencies is a budgetary rounding error.
Compare that to either Doritos and you don't get anywhere close. Doritos cost >$10 per kilo, and cost >$100 per kilo of protein, has low fiber, high fat, high salt. It's not nutritious, actively harmful and actually extremely expensive to fuel the body this way.
And it makes sense: processing ingredients leads to a more expensive product than the base ingredients. This is true in every economic sector. Only uniquely, in the food sector ultra-processing doesn't only lead to higher prices for the customer (the reason companies do it in the first place) but also less healthy outcomes.
Doritos are made of corn and vegetable oil. The prices of these ingredients are orders of magnitude lower than the end-product. Corn is like 30 cents per kilo, oil about $1.50. If you want the same nutrients without processing like frying etc, you can eat literal orders of magnitude cheaper.
And anecdotally, when I am eating healthier I am opting for a larger range of ingredients. Probably to keep my mouth interested as I am not getting the food that's been engineered to be perfect to my palate. While potatoes and beans are in my diet, I am also opting for a lot of vegetables that are more expensive, paying more for fresh herbs and interesting spices. I am almost always buying canned beans, sauces, and other foods with some processing to speed up prep time.
I think your analysis suffers from comparing processed food engineered to taste great to the blandest, driest raw ingredients. Factoring in the time and secondary ingredients to make those raw ingredients taste great adds a lot of cost. Add in the cost of more varied ingredients bc very few people want to eat beans, potatoes, rice, and bland chicken every day. And further, you're missing the savings processed foods add by being shelf stable. They can sit on a shelf or in a freezer for months or years vs. fresh produce with a much shorter lifespan.
So yes you can eat very cheap and very healthy, the vast majority of people will loathe that life over time. You can eat kind of cheap, very healthy, with a limited number of ingredients and have things taste great if you have a LOT of time to devote to cooking, this will still not satisfy many.