Bloodworms are the larval form of midges, which look very similar to mosquitoes. The worms are typically less than an inch long and are deep red in color because of the presence of blood hemoglobin in their systems. The pregnant female midge will lay eggs on the pool's surface. The eggs hatch after two or three days and the larvae will move within your pool until they become adults four weeks later.
Midges prefer to lay their eggs in stagnant water, so any water-containing receptacles like cups or bowls or flower pots around your pool area could attract them and ultimately lead them to your pool. Bloodworms feed off detritus and algae, so a dirty pool that is not properly treated with chemicals like chlorine may accumulate the kind of food the larvae need to survive. Lights also play a factor. Midges are active at sunset and are attracted to light, so pool lights will undoubtedly help draw them in.
Check the pool every day for midges or larvae. Scoop out any larvae you see regularly and toss them aside. They are wholly aquatic so they will die in your yard's grass. Clean the pool routinely using the proper chemicals, and check the filtration system regularly to make sure the water is circulating. Midges prefer stagnant or slow-moving water, so a moderate current will deter them from attempting to lay eggs in your pool. Keep the lights around your pool at night to a minimum.
Another possibility besides bloodworms is that your pool is infested with mosquito larvae. These are known as wigglers and look very similar to bloodworms with the exception that they are slightly fuzzier, smaller, much quicker and move in jerky patterns (hence their name). The steps necessary to prevent and control bloodworm infestation is identical to those required for preventing wigglers: remove standing water, keep the pool clean and scoop it out daily.