Because an earworm crawled into your head. Here’s a nice article about the little creatures:
Earworm, a calque of the German Ohrwurm, is a term for a portion of a song or other musical material that repeats compulsively within one’s mind, known colloquially as “music being stuck in one’s head”. Use of the English translation was popularized by James Kellaris and Daniel Levitin. Kellaris’ studies demonstrated that different people have varying susceptibilities to earworms, but that almost everybody has been afflicted with one at some time or another. A more scientific term for the phenomenon, involuntary musical imagery, was suggested by the neurologist Oliver Sacks in 2007.
There have been claims “that earworms may be songs or tunes that become stuck in the phonological loop, the part of the brain that rehearses verbal information in Baddeley’s model of working memory. This usually happens when a person sings the song or hums the tune once and then repeats it in his or her mind.”