Earthworms are good for soil! As soil and thatch are eaten and pass through the worm they are mixed and digested. The worm then excretes the soil mixture; in this way it helps control thatch and the excretion improves the soil.
So, worms are beneficial. However, it is possible to have too much of a good thing and sometimes a lawn can be overwhelmed by worm activity. The result can be a lawn covered in slimy soil patches which is a misery to cut and is open to weed invasion.
It is only those species that feed at the surface of the soil that leave casts. Many other species are at work below ground.
Here are some suggestions for addressing worm problems:
Let the muddy castings dry out, then brush them back into the turf, particularly before mowing.
Do not let turf get soggy. Only water heavily and infrequently if necessary, this will allow the surface of the lawn to dry out between waterings.
Collect and dispose of grass clippings to minimise earthworm activity by reducing the amount of food available to the worms.
Remove fallen leaves from the lawn regularly for the same reason.
Use chemical control as a last resort.
Chemical control is not a one-off application and cure. As noted above it is only certain species of worm that cause problems and of these it is only the mature worms that come to the surface to feed. The juveniles remain in the burrows, out of reach of chemical applications.