The dealer being a legal entity incorporated in the same state you bought the car insures that they operate under state law and makes it far easier for either the state or the individual to seek legal redress when needed.
In addition, the fact that they're separate from the manufacturer means their incentives are also not aligned. They're incentivized to find issues, both pre delivery and during maintenance (especially during the warranty period)
how are their incentives not aligned? both are there to make money by moving as many vehicles as possible. if a problem is found with a vehicle they have on their lot then it’s out of inventory until it’s fixed or replaced. the incentives look exactly the same to me.