Was there any any explanation, either in canon or out of universe (e.g. interviews with the writers), as to why Bill Murray's character initially got stuck in the time loop?
According to the film's writer, Danny Rubin, the original idea was to leave it completely unresolved.
One more question to solve: how did Phil get stuck in time? Was there a time machine? A gypsy curse? A celestial anomaly? A magic clock?
Even thinking about these things it was obvious that they were interchangeable, uninteresting, and completely unrelated to what was exciting to me about the premise. So I decided not to have any explanation at all. What I liked most about this totally logical but somehow heretical idea was its existential flavor. The movie became so much more human and relatable since none of us knows exactly how we got stuck here either.
At the insistence of the studio, he then created a second draft of the script in which Phil was cursed by his ex-girlfriend as an explanation for the time loop.
INSERT : A THICK BOOK The cover reads "101 Curses, Spells and Enchantments You Can Do at Home." A well-manicured feminine hand opens the book to a marked page .
INT. CHERRY STREET INN - NIGHT - SAME TIME : Phil enters his room and drunkenly tosses his overcoat, scarf and gloves on the floor in a heap.
INT. STEPHANIE'S BEDROOM - NIGHT : Stephanie Decastro, Phil ' s disaffected ex-lover, is sitting cross-legged on the floor with the book of curses open in front of her. Her hair is down, she's wearing a caftan with a Zodiac print, there are candles everywhere and other vaguely occult decorating touches.
INSERT : Phil's business card is dropped into a dish. Then the Tarot card of the Hanged Man, a chicken bone, and a feather are placed on top of it .
PHIL : He stands at the sink, looking at himself in the mirror, flexing his muscles.
STEPHANIE : Reading from the book she mutters incantations in a secret language, then she sprinkles some powder on the plate, then a few drops of oil. Then she makes a few passes over it with her hands and, much to her surprise, the contents of the plate spontaneously combust.
PHIL : As he crosses to the bed, he accidentally knocks over the suitcase stand, spilling his clothes out onto the floor.-25- He contemplates picking them up for a moment, decides to leave them there, and flops down on the bed. He lies there looking u up at the ceiling until the room starts to spin around, then he closes his eyes and quickly drops off to sleep, still fully clothed.
STEPHANIE : To complete the spell, she picks up a broken wristwatch and drops it into the fire.
INSERT : Phil's business card, the Hanged Man and the broken watch in flames. The watch crystal is cracked and the hands are frozen at 5:59
But after they trimmed her character from later versions of the script (finally removing her entirely for the film), that plotline made no sense so they seem to have decided to return to leaving it as an un-resolved question.
Purely out of interest, it's also worth noting that in the earlier draft, the original spell kept Phil in the loop for 10,000 years(ish) and that it was Rita's kiss that finally broke the curse.
Phil : You want to know what's really amazing? I've been waiting for you every day for ten thousand years. I dream of you every night of my life. You've been my constant weapon against total despair, and just knowing you exist has kept me alive. How's that?