Sometimes our bodies are full of energy and we need to expend that energy outward to stay sane.
For example, if you are waiting for the bus to come, and you find yourself going crazy just standing there, it will be worthwhile to walk a few blocks down the line and catch the bus then. You still get to your destination at the same time, and you stay sane in the process.
It is best to be able to calm the mind down to where you don’t feel the need for constant motion. Then maybe the energy you did not waste by walking around could be put to a better or more noble use.