Are you sure they are attached to the fish? Otherwise, they sound like
planaria and are harmless but are generally a sign of overfeeding. You'll
find lots of them in the gravel and they will sometimes climb up the glass
if there is a lot of uneaten food. This happens often in fry tanks where
heavy feeding is usually taking place. Also, stirring the gravel can cause
them to do that. Maybe that happened when you tried removing the snails? I
suggest a water change and vacuuming the gravel a bit.
Carvi