Not all flatworms are parasitic. The Planarian is a free living flatworm with a digestive system (mouth and gastrovascular cavity) and a ladder like nervous system with eye spots and a brain. They also have muscle cells capable of moving the body through the water.
The tapeworm is an intestinal parasite that does not contain a digestive system since its body is designed to absorb digested food from its host. It is hermaphroditic and self fertilizes its own eggs. Parasites conform to their host and co evolve with them. So the tapeworm lost the ability to digest food and move since it no longer has any use for these systems. Its reproductive system took over since the need to reproduce is crucial to its existence.