Lots of reasons for this.
- Fatty food costs less per calorie than healthy food. It's much cheaper to get a certain number of calories from junk food.
- The most convenient foods (fast foods) are very unhealthy (in general). So busy people will consume a lot of these.
- There is little immediate cost to being fat. You don't get charged extra for most things if your fat, you don't get lower pay (or at least you can't be sure that you get lower pay if you're fat).
So... there is not much in the way of immediate costs to gaining weight. But there are benefits to eating an unhealthy diet -- it's easier and it's cheaper.
I very much doubt if a reasonably valid cost-benefit will support the kind of behavior that leads to people getting fatter or obese to an extent that it is harmful for their health. General principles of economics, particularly the ones dealing with utility also do not explain why people do things that are harmful to them. Economics actually assumes that people in general decide to buy and consume goods that give them maximum possible utility for the money they have. The widespread phenomenon of obesity caused by excessive consumption of junk food by willing customers, actually an example of limitation of economics to explain human behavior too accurately.
The phenomenon of obesity can be explained more by the limitation of individuals to know for sure what is good for them. Also it is because of the conflicts in human motivations between immediate gratification and future gratification. People, are now by and large, aware of the problems of obesity, and usually they do have economics means available to eat more healthy food, But that kind of food may not be as tasty, and may not be compatible with their lifestyle. In contrast the problems of obesity is some thing that will happen some time in future, and therefore the the psychological pressure of likelihood of having health problems is not very strong.
Thus obesity is more due to people giving in to immediate emotional impulses rather than act based on a systematic cost-benefit analysis of their actions.