Roots may emit a chemical them critters don't like. Orrrr,... they get very tangly and dense and may emit an odor the moth doesn't like. Orrrrr.... It covers the squash scent. They ARE powerful tasting. Who knows what a bug senses if it can find if it can find the plot of specific flowers it prefers in the dark of night solely by smell or infra-red or ultraviolet detectors.
No actual idea, just surmising from what I DO know about them.
“We are all born ignorant, but one must work hard to remain stupid."
~ Benjamin Franklin