In vedic-ayurvedic astrology, planets rule ceratin tastes.
Sun: Salty. Also a spiritual simple natural satvik diet. Foods which increase Pitta dosha.
Moon: Sweet. Foods which increase Kapha dosha.
Jupiter: Sour.
Saturn: Bitter, astringent. Foods which increase Vata dosha - excess imbalance in vata can cause anxiety and depression.
Mars: Hot, fiery. Increases Pitta dosha
Mercury: Interesting, tasty foods
Venus: Rich, luxurious, gourmet Rajasic foods that increase Kapha dosha
Rahu and ketu: Weird, pickled, smoked, preserved, unnatural Tamasic foods which increase Vata dosha. Excess of Vata causes imbalances in the mind. In vedic, rahu and ketu conjunct significators of the mind is said to cause aberrations in thinking.
In vedic, moon signifies the mind - so if you eat too much of sweet/sugar this can increase Kapha dosha and thus cause dullness and laziness of the mind. So it looks like they were right.