These are bloodworms (Chironomus sp.) and have probably been sucked into the filter intake during feeding. To avoid this, try feeding with a worm feeder, which will ensure all the worms are kept in at the surface when feeding, and prevent all the worms being blown about the tank.
They're most likely midge fly larva (blood worm). Harmless...I get them at least once or twice a year cuz my tank is right next to my patio door. If they're in ur filter, then they're probably on the bottom of the gravel also. I just wipe and remove the egg mass usually around the lip of ur tank and filter. Vac up what I can underneath the gravel and feed them to my cichlids. http://www.ces.ncsu.edu/depts/ent/notes/Urban/images/midge-lc.jpg