I'm not very knowledgeable on how to deter worms. I mostly know how to attract them. Although if you're wanting a great lawn for playing croquet worms are your best friend.
I don't know if any worms large enough to leave the piles behind that you are talking about. Usually earthworms, such as nightcrawlers that are deep burrowers, leave behind very tiny amounts of worm castings that are maybe a half an inch high but you would not see that in grass without looking very hard for them.
I believe what you might have in your yard is a type of land crayfish. When it comes to getting rid of these critters this is way out of my realm of knowledge. I'm sure with a simple youtube search you may find how to get rid of them.
Thanks for the question and I hope you can get back to playing croquet as soon as possible :-)