Doing it well (so the toilets are clean and safe) obviously costs money. And obviously Tesla would prefer not to pay money. I don't think that's the issue you think it is. Tons of pollution mitigation efforts cost money that companies don't want to pay and yet work because of laws requiring them.
My city tried to force a public toilets ordinance on local businesses. Those businesses either ignored it or converted to take out only or other business models where they were not bound by the law.
It got rolled back pretty quick.
Plenty of businesses will simply call your bluff for such silliness. They do not exist to solve social issues local government created in the first place.
If local governments can’t even afford to keep public restrooms going at parks, public transit stations, etc. it’s not reasonable to expect businesses to shoulder that cost for them.
Keeping them clean is the easy part. Doing it well would require building the infrastructure, maintenance, manning the station, preventing drug abuse etc, and getting into liabilities due to said abuse.
Tons of businesses stop doing business if they are forced into efforts that dont make money. The city/state should own sanitation. Not private companies.