Even though they have developed heads, they do not have real brains. Two ganglia that run along ventral side of their are masses of nerve cells bodies.
The development of nervous system in those worms allow animals that evolved afterward to take advantages of their surroundings. Organisms can react with their environments. This lead to adaptations to changes in their habitats or ecosystems. Nerve cells from all parts of their bodies send signals to the brains and back to the parts. Organisms are able to function more with the development. Their organs have to work together to reproduce required response.
For an example, nervous system allow animals to feel plain and uses their muscles to run away. They breathe faster as their brains need more oxygen. In a flight or fight situation, their brains will shut down digestive system to send more blood to the muscles and internal organs. Sensors tell their brains to cool off the bodies when they are over heating as they run.
Without nervous system, the animals would be dead. Their bodies would not function the way they should. Being motionless will not help them in any way. Preys would not be able to run from predators, they will not be able to move or even to take in oxygen.