if older 2 wire circuits were a code violation, then how would they be wired to an older 3 prong plug with 2 hots and a center ground?
It was done because people who didn't know what they were doing wired them. Unfortunately this does happen.
Which is what was used everywhere
Just because it was done everywhere doesn't mean it was ever legal.
The center conductor (ground) was used as a current carring neutral for any 120 volt on the dryer.
Again, never was code and is one of the more dangerous mistakes made. Especially with a large metal box usually associated with water.