Your diet creates an environment for your gut bacteria – both good and bad. Researchers call it an ecosystem. Problem is, when you try to change your diet, your "bad" gut bacteria will demand to be fed, making you experience cravings. It's a lot like withdrawal symptoms.
Bill Roberts explains: "Metabolically-unfavorable gut bacteria can cause cravings of the junk foods that best feeds them. They can also cause you to feel dysphoric (bad) feelings when they're deprived of their favorite foods. The good news is, you can break their control fairly quickly by not giving in. When you consistently don't give in, these bacterial populations reduce, you become metabolically healthier, and you start feeling better than ever."
Think of it almost like a relationship between parasite and host. To continue thriving, your gut bacteria consumes what you give it, and makes you feel physically deprived when you go without it.
How to Fix It
If your gut's ecosystem makes you crave what you consistently eat, then change your cravings by changing your gut's ecosystem. Want to crave healthy foods? Then consistently consume them. Feed the good gut bacteria.
How do you get rid of the bacteria that makes you want more crap food? You starve those little bastards. Yes, you'll feel "deprived" at first. Count on it. But you can survive without junk food. The bacteria that feeds off it can't. Eventually you won't feel as compelled to have low-nutrition foods densely packed with calories (i.e. junk food).