Tapeworms are parasitic animals that derive their nutrients from the body of their host, such as a dog, bear, fish, or deer. The niche of parasitic worms end up contributing to strengthening host populations overall. The tapeworms weed out sick individuals of the species who do not survive the parasite's attack, or who are too sick and weakened to breed or feed, or who are killed by predators more easily because they are sick. The hosts who survive the parasites and become strong again, or who are not weakened by the parasites, are able to contribute to a stronger overall population.
Planarians are flatworms of the class Turbellaria. These flatworms can be found in a variety of habitats, such as in salt water, fresh water, and land habitats. They are not parasitic worms, and as such, contribute to a totally different niche than the parasitic tapeworms. Planarians actually contribute significantly to water-based ecosystems, and often act as bio-indicators of overall ecosystem health. The planarian's use of regeneration and potential biological immortality has led to a significant amount of research occurring on planarians and stem cell research and aging research.
While the planarian worms may appear to be a more "positive" part of an ecosystem, parasitic worms are also significantly important in contributing to the balance of life on Earth.