Someone actually did a study on earworms. Really.
“Dissecting Earworms: Further Evidence on the ‘Song-Stuck-in-Your Head’ Phenomenon, James J. Kellaris, PhD, presentation to Society for Consumer Psychology, Feb. 22, 2003.
It’s summarized at http://my.webmd.com/content/article/61/67505.htm. Be warned, though—it lists the top ten earworms according to the study, and reading the list could trigger an earworm attack.
Oddly enough, I don’t find any of the songs listed to be an issue for me. Or I didn’t—until being reminded of them.