Worms are able to survive in water and puddles for up to a few weeks without drowning or dying.
Also worms don't drown in the water or puddles like a human can drown in the water since worms are able to absorb oxygen into their bodies from the water.
So just being submerged in the water doesn't mean that the worm cannot breathe like a human would not be able to breathe underwater.
However worms are unable to swim so the worms need to be able to get out of the water after a few weeks so they won't die.
But if they can't get out of the water and get food then the worm will die.
So although a worm might die in a puddle they won't drown in a puddle.
Worms usually die on pavement and sidewalks because of their bodies drying out because they need moist skin to survive.