The reason that so many worms make their way up to the surface after rain is that some species require more oxygen which cannot be found under the ground when the soil is flooded with water. However, other explanations include the worms trying to get away from predators (which the rain sounds like) or even using the time to migrate as it’s easier to move long distances on the surface compared to underground.