Flatworms (apart from the turbellarians, (planarians are in the class turbellaria)) are parasitic and don't need complex nervous systems. A parasitic animal devotes much of itself to reproduction and doesn't worry about other tasks. Cestodes don't even have a gut, they absorb food via diffusion through their skin. Annelids are free-living animals, and they need to move around more. They don't spend their adult life hooked to the inside of an animal, they move around, and need a more complex nervous system to give them a better view of their world.