Drowning
One proposed reason that the red worms come out during the rain is that they are drowning. Worms do not breathe in the way humans do, but rather through their skin. When it rains, the soil fills up their burrow with water, changing the oxygen in the burrow. The University of Wisconsin quotes Teri Balser, associate professor of soil and ecosystem ecology at the school, in stating that the worms are drowning. Professor Balser suggests that the worms come to the surface to breath and then cannot find their way back to their burrows.
Mating
Another possible reason the red worms come out during rainfall is to find a mate. Cecil Adams, writer of the Straight Dope news columns, quotes wormologist Richard Wahl, who stated that the worms do not have enough space in their burrow to mate, so they come out during the rain to find a mate when the conditions are wet enough to prevent dehydration.
Sickness
Sickness is one of the proposed reasons for the worms to come out of their burrows during the rain. Cecil Adam's quotes Charles Darwin, who suggested that he believed they were already sick and the rain brought them out, where they died faster. Dr. Stephanie Susan Smith writes in the Garden Writer's Association that once the worms are out of the ground, they are no longer effective when put back in the soil due to sickness.
Use of Red Worms
Red worms are a type of earthworm and they are primarily used for composting or gardening purposes. The worms eat the compost material and turn it into fertile soil, thus why they are sometimes called manure worms. Sometimes red worms are used for fishing as well, since they live longer than other worms and thus catch more fish.