There are other ways a snake can pick up parasites too: do you ever let him crawl in the grass outside? I really wish you had kept the worms to test & taken pix of them to post here, since from your description, they could have been from either the snake OR the substrate that got into the water bowl*, & without seeing them, we'd only be guessing. (*normally, if they were from the substrate, there's no way they could have crawled into the water bowl, so that would have been more conclusive.)