Yes, bad diet habit is a major reason for putting on weight along with sedentary lifestyle.
Bad diet include:
Untimely food
Junk food
Aerated drinks
Repeated eating or munching
Short duration between two meals
Having food before the previous meal has been digested