or some plants gathered outside in that aquarium? You may have had some hitchhikers.
Dero worms or Naiad worms are among the detritus eating worms that clean up decaying plant parts. They are commonly found in duckweed and algae mats. Masters in his Encyclopedia of Live Foods mentioned Dero and Nias and a couple of related worms as great fish food. I find them once in a while in my Daphnia cultures.
Tangentally, you didn't feed blackworms and have them get loose in the gravel? Sometimes they will abide and even reproduce there. However the gravel can sour, the blackworms perish and the tank really can bomb - so I work to get them out of the gravel if there are very many. (Don't treat for parasites with blackworms in the gravel.)
You may want to Google for images of the genus Dero, Aeolosoma, Naias. Just to be on the safe side, maybe also Google for aquatic tape worms - in case that came out of one of your fish.
Let us know if there is a big difference and what the worms in your aquarium most likely are. If you have treated those fish for parasites before and recently added plants, I would guess they might be those detrivores which make good fish food. Otherwise, I too would be concerned.
All the best!
unc