If by "legitimate" you mean "useful" or "good" (as opposed to the law not being passed through the established legislative process, because that criticism wouldn't make sense), then even then it was illegitimate. If the manufacturer can come in and undercut the dealer, they should. Unfortunately, the dealer was local and the manufacturer often wasn't. The same reason any protectionist measures are created.
Eh, it was useful for car manufacturers when they were first getting going: they didn't have to put up the capital to open shop. The regulation came in when a dealership showed that a given region had high demand for the company's cars, so the company would move in across the street and undercut the franchised dealer. Obviously the franchised dealer had more clout with local politics than the auto manufacturer did - this is why all the dealership laws are state laws. It was kind of a legitimate regulation back /then/, but really has no bearing on things now (especially for a car company that has never franchised any dealers).