Yes it's called chewing and spitting. Chewing and spitting is a highly addictive habit, and its also habit forming. On the surface, chewing and spitting may not seem like a very harmful thing to do, but it is linked to food deprivation as the type of food being spat out is rarely actually eaten. Although cravings for it can be strong, the food spat out is considered 'bad'. Chewing and spitting can also invoke a sense of waste and guilt about the food that is quite literally being wasted. Chewing and spitting out sugary foods can still do damage to teeth, perhaps even more so, as the quantities of sugar ending up in the mouth are larger than if food was actually swallowed and eaten properly.
There's nothing good about depriving your body of the food it needs. Food that ends up in the mouth should be swallowed. Rather than chewing and spitting out certain types of foods, it's better to actually eat them in moderation.