Some places it is legal. It was probably enacted to prevent people from leaving junk cars on their front yard. In one town I lived in, it was illegal to park your car overnight on the street in front of your house. It had to be parked in the driveway.
That one makes perfect sense in Michigan in the winter. Picture trying to plow the snow with a lot of cars parked on the side of the street. I know a guy who lost his job as lot boy at a car dealership many years ago because the snow drift he plowed was 60% snow and 40% Cadillac. This law would put the responsibility on the car owner.
That's how it is in most cities in my state during the winter. Snow emergency law. That one actually makes sense because the roadplows are significant to public safety.