1) He has an eating disorder. What he is doing is called "emotional eating." If he only ate when he was truly hungry, healthy food would taste better to him, but since he eats on emotional impuse and isn't truly hungry, of course he is going to go for treats like ice cream and cake.
He needs to re-learn his "hunger" feeling properly so he knows the difference between being truly hungry and wanting to feed his addiction (sorry for the pun.) Hunger is an empty feeling. Hunger builds slowly. Hunger is satiated by any food, not just specific desired items.
Emotional eating comes on suddenly, seems overwhelming, and is usually a craving for something very specific.
2) Have him keep only healthy foods in his house so that if he does have the impulse for junk, he'd actually have to leave the house to get it.
3) All or nothing mentality can make dieters binge. If he feels too restricted by his new diet, he'll be that much more tempted to overeat the wrong things. If he sets aside, say, one day a week where he allows himself treats, he can make a gradual change in eating habits over time instead of feeling like he is on some horrible restricted diet where he can't have ice cream for months. It's kind of like the principle of the harder you try to not think about something, the more you'll think of it.
4) He may need counseling.