As with most things, "free market" is what they demand when they don't get have access to the market or can't command the whole market.
Once they have access or enough of a percentage to set the prices, suddenly the best thing is high barriers to entry and whatever else will help them maintain inelastic demand.
Many of the laws blocking direct to consumer sales of automobiles are old; literally dating back to when automobiles themselves were new. In many places those laws have been updated but that means we need to add nuance.
I live in Wyoming so that's the first example I'll use. Our law was updated in 2017 to allow direct to consumer sales -IF- the manufacturer hasn't previously sold new vehicles in the state using dealerships. So a company like Tesla or Rivian can sell directly to a consumer while the more traditional brands such as GM or Ford can't EXCEPT...
"A direct sale manufacturer shall not include an affiliate or wholly owned subsidiary of a manufacturer's line make that is presently sold or has previously been sold in this state through a new vehicle dealer."
So for example Ford can't direct sell any of its regular products here but they could direct sell things from their Troller brand. GMC can't direct sell you a Terrain but they could direct sell you a Baojun.
So here in Wyoming it can be done by nearly any new auto manufacturer and the existing ones can also do it IF they're willing to use a Brand that has never seen sold here new by a dealership.
In other States, like Colorado, they allow DtC sales but ONLY "...if the manufacturer makes only electric motor
vehicles and has no franchised dealers of the same line-make. " So the normal auto manufacturers can't do DtC at all UNLESS they get rid of all their In-State dealers but companies like Tesla and Rivian can do it no problem.
You can look at this pdf, last updated in 2019, for a state by state breakdown.
Do you know why the laws generally prohibit direct-to-consumer sales...
My understanding is that way back in the beginning of automobiles the manufacturers couldn't afford to build sales and service outlets all over the place so they followed a franchise model. The franchise owners, called dealers, would invest in building a Dealership that bought vehicles from the manufacturer and then resell them to customers, when those vehicles broke they would fix (service) them.
After a while the auto manufacturers built up enough money and started building their own Dealerships but that put them in direct competition with the existing Franchise Dealerships. It also put their existing Franchise Dealerships at a competitive disadvantage because vehicles at their own Dealerships didn't have the markup on them like the ones the Franchise Dealerships were forced to purchase. In many places the Auto Makers didn't want to do Service either, they just wanted to open Showrooms and do Sales.
So the Franchise Dealerships went to their State Legislatures and had them pass laws so that the Auto Manufacturers couldn't open their own Dealerships or sell directly to consumers. It was, and is, protectionism but it makes a certain amount of sense from both the Franchise Dealership and Consumer perspective. Franchise Dealerships didn't want to lose their businesses to unfair competition, communities didn't want to lose the jobs, and customers didn't want to lose the ability to get their vehicles fixed.
...or why Wyoming has such odd exceptions?
If you look at the PDF I linked you'll quickly notice that almost all of the States that allow DtC Sales have odd exceptions and the common theme is protecting EXISTING Franchise Dealerships while creating a path for DtC sales for new Brands or types of Vehicles. Most of these laws were passed between 2014 and 2020 and they exist because of how much demand there was for Tesla's vehicles which are only sold Direct to Consumer. Citizens of a State wanted to buy them and couldn't so they pushed their State Governments into changing the laws.
A ton of dealership money comes in due to their service side. For all electrics there's no oil change. Brakes last ages. Fewer parts to break down. Etc. Dealerships will lose a ton of money on service work, including missing out on selling a new vehicle to a current customer that comes in for an oil change.
Also, almost no one should buy a Ford lightning. Only people that use it like a car and not a truck, but want to look like a truck owner.
It’s not, there are 60k private dealerships in the US and they weren’t even included in the original survey the Washington post article mentions which is what this article is written on