Yep earthworms are very good for the soil. They help to aerate the soil and they digest organic matter which is their diet, they leave behind the castings which contain a lot of beneficial things that are good for the soil and plants.
I've heard earthworms referred ot as the intestines of the soil. There's nothing like a good earthworm population to keep soil healthy. If you have minerals like calcium or phosphate that are tied up in your soil and unavailable to your plants it immediately becomes available after being run through a worm.