Why Are Earthworms More Advanced Than Flatworms?

Why Are Earthworms More Advanced Than Flatworms? With a circulatory system to distribute blood and oxygen and a one-way gut, their bodies are enormously more complex than modern flatworms. Developing a gut that runs from one end of the body to the other was a major evolutionary step. Why are roundworms more advanced than flatworms?