What *kind* of worm did you feed it? If not a night crawler or that ilk, but a red wiggler worm/trout/pan fish, your snake didn't like the taste as those kind of worms ARE NO GOOD.

If the worm is bitter/whatever you snake will go for it but once it tastes it will spit it out and try and 'clean' its mouth and try and 'spit out' the bad taste.

What kind of worm, from where, did you feed it?

What was the worm you fed it?