Without a picture I'm going to assume it was a stick worm. Even tho there are many types. Anyway. Size hook , and line ? Also the rod can come into play.
But I'm willing to bet that the bass didn't have the worm in its mouth all the way to the hook. it could have been small bass, That didn't take the bait all the way. Either that or you set the hook to late , or too soon . Also maybe not hard enough or too hard.. it's something that happens.. everyone loses fish. "That's why they call it fishing not catching "
Btw. If it is a stick worm. And the pond or lake isn't very weedy where you are fishing . Try a wacky rig. Where you hook the worm in the middle of the bait only, so that both ends dangle freely. This is a effective and near fool proof technique. There are hooks that are made especially for this but you can do it with just about any worm hook.
I suggest you do some reading about plastic worms and whatever else you're curious about. A plethora of information is at your finger tips.
Good luck bud.