The problem with free (cooked) food, especially junk food, is that it is very addictive. The opioids in cooked foods affect the brain, causing addiction.Grains and dairy also contain opioids. Plus, cooked junk foods do not usually generate immediate health-problems for those already eating cooked foods for years. Of course, such people do develop health problems like type 2 diabetes therefrom, but are not able to discern a link as the health problem does not immediately appear after junk-food-consumption.
Advertising does work. I know many people who went to McDonald's because it was seen as a social meetup, not just for eating junk food.