I always thought it was tow, like a tugboat towing something and keeping it aligned.
Instead it’s about foot races!
“ The phrase means “follow the rules or obey an authority.” “Tow the line” is a misspelling based on “toe” and “tow” sounding the same, but “tow the line” is always an error. The phrase comes from the idea of standing at the starting line before a race (i.e., getting as close as possible without overstepping the mark).”