Online sales favor small manufactures with limited choices but in most cases dealerships help offload a lot of manufacturers cost and reduce their risk. In either case the government shouldn't be the deciding factor in determining which option your company chooses and it should never have been involved in the first place. These laws were originally meant to protect dealers from having to directly compete with manufactures who might decide to muscle them out of a profitable area by opening up a competing lot. That's all well and good but should never have been put into law, that's a contract condition, not a legal one.
Dealers add to the system by paying for the physical storefronts, paying franchise fees and a lot of local promotional costs. In return they get to profit off of the few buyers who can't haggle in the slightest but generally make real profits on the service side. It's worth it to sell a $30,000 car for just a $500 profit if you can get a person to come back to you for $60 oil changes once or twice a year, plus $500 in new tires every couple years, plus whatever other maintenance charges they can come up with.
At present, it makes sense for most manufacturers to use dealerships (or at least some sort of parking lot style sales system). Just the vast array of options available means a person is more likely to need to see the physical vehicle before making a purchasing decision. Chevy, for example, has 19 vehicles currently available for sale and each of those has several models with a vast array of trim and performance levels. Tesla, by comparison, has 2 and while they offer some variances in trim, you're still getting essentially the same car no matter what you choose. For Tesla having a dealership full of 50-100 identical cars is just a waste of money. If you want a Tesla you want a Tesla and having one available for viewing in a small mall storefront would generally suffice. You should then be able to then go online and customize you trim level and order away without any government interference but the guy buying the Chevy is still most likely want to see all his options in the flesh.