It's not necessarily more expensive than home cooking. A value menu cheeseburger at McDonald's is $1[1]. First result on google[2] says ground beef, 100% beef, per lb. is $3.75. The McDonald's cheeseburger's patty has a weight of 1.6oz or .1lbs, which of the aforementioned ground beef would cost $0.375. Tomato is estimated at $0.08 cents per slice, buns at $0.41 per bun, and lettuce at $0.02 for a leaf[4]. The slice of cheese is estimated at $0.29[5].
.375 + .08 + .41 + .02 + .29 = 1.175. So the homemade burger costs more not even accounting for the opportunity cost of the time to make it, the fact that you're probably not going to use all those ingredients and eventually throw some of them out, gas/electric for the stove, and possible butter/vegetable oil.
Not that it isn't worth it to make homemade burgers - they're definitely better than McDonald's, especially if you get local grass fed beef, but I like the unique taste of fast food restaurants and the economies of scale work in their favor to make things cheap, sometimes cheaper than cooking it yourself.
And on health, I don't see how the McDonald's burger is any worse for you than a homecooked one. McDonald's one probably has less grease. Maybe beef quality, but I'm not sure quality of beef has a direct impact on healthiness.
1: https://www.fastfoodmenuprices.com/mcdonalds-prices/
2: https://www.bls.gov/regions/mid-atlantic/data/AverageRetailF...
3: https://en.wikipedia.org/wiki/List_of_McDonald%27s_products
4: https://www.aol.com/2011/03/01/savings-experiment-the-great-...
5: https://www.marketwatch.com/story/heres-exactly-how-much-you...
More realistic would be to compare the food value derived from a $1 McDonalds hamburger with what $1 can buy at a discount/bulk grocery store in dried beans, sweet potatoes, onions, and other high bang-for-buck items.
The whole paleo thing. What I jokingly call the "troglodiet". Beans, wild rice, big leafy greens. Much less meat, dairy, starchy carbs.
It's weird that cheaper is more healthy.
I really only need a pressure cooker, cutting board, knives, a few bowls, some storage. I've unloaded most everything else. I'm basically camping at home.
But I had to get more wealthy to even become aware of these options, choices.
Typically they do. Poor people aren't idiots. They know that prepared store food is grossly overpriced compared to a similar meal they assemble themselves and seek to avoid it as much as possible without spending too much time/effort on meal prep. They usually manage to drag themselves to Walmart or the local supermarket every 1-2 weeks. Even if you have to drag your ass to some far away supermarket because it's the only one open after you get home from work and get 3hr of sleep that night you'll still do it because of the huge cost reduction compared to prepared food or whatever your local convenience store has. You'll buy the same bunch of things every time because over time you figure out a bunch of relatively low effort and low cost meals and then stick to them. Lunch or breakfast will probably be the same thing every day and you'll skip the other. They buy gas station sandwiches and junk food more than the rich because when your menu is the same boring things on a 2wk cycle so it's a nice, low mental effort, way to shake things up from time to time.
The home cooked meals poor people eat are just far less balanced than ideal because they're more skewed toward ease of prep and cost than what rich people eat. Instead of a salad they'll bring a PB&J and a few Oreos to work. Something like (microwave) baked potatoes and chicken nuggets, maybe with a vegetable side (or something similarly imbalanced but cheap) will probably be on the menu at least one night a week.
"Food deserts" are a problem but less of a problem than they seem to be because what rich people think poor people should be eating and what poor people think they should be eating are vastly different.