Because in most cases it's literally illegal. https://en.wikipedia.org/wiki/Car_dealerships_in_the_United_...
The exception is service, because that's actually a separate market and not just a middle man on sales in the original market. Prohibiting manufacturers from operating service centers and leaving it to independent mechanics is essentially a ban on vertical integration and still makes a lot of sense. Because service for a particular model of car is in many ways back to being a consolidated market, since that model may need specific parts or tools and you still want to maintain a competitive market for service for customers with that model of car. You also want to make sure mechanics can service cars of multiple makes, since that fosters competition too.
Most people go into a car dealer expecting to haggle. For better or worse, we know they're going to screw around and so we're prepared to do battle. If you go into it with a different mindset, it can be pretty painless most of the time.
Walk in the door and offer them MSRP. Then fill out the DMV registration paperwork, give them your payment, and leave with the car. It won't be quite as smooth as Tesla because you're not pre-filling this out online, but it is still pretty painless.
During the pandemic this wouldn't work because the market was commanding premiums on available stock. That means mark-ups from dealers, but Tesla is hardly immune -- go look at what a Model 3 was priced at later in 2022. The difference is that dealers at least have -some- competition. Tesla just tells you what you must pay.
So does Dell or Samsung. That doesn't mean they have no competitors.
And the carmaker is ultimately deciding what the dealer has to pay, so what's the difference except another middle man wanting a cut?
Manufacturer-to-consumer sales make the most sense for big ticket items and things that can be easily sold over the internet. Retail stores can make more sense for perishable goods and things you might want to inspect before purchasing and convenience purchases and things with a high ratio of shipping cost to price etc.
Still not as ideal as other countries, but cest la vie.