It's ironic that San Francisco, the city so closely identified with the burgeoning sharing economy, would be defending an onerous law that undermines one of the tenets that enables these web-based companies to flourish. It's the latest example of the city's hostility to the companies that buoy its economy.

San Francisco officials recently passed a law that's meant to crack down on residents who improperly rent out their properties as short-term rentals. A previous law allowed property owners to rent out their homes and apartments, provided they follow myriad regulations and limitations. One rule: They must register with the city.

"Enforcing this law has been tricky, so the city's Board of Supervisors recently passed an update saying websites like Airbnb can be punished if people listing homes on their sites haven't registered with the city," according to Bloomberg. This rule targets room-sharing companies, but if the approach takes hold, it could pose a threat to any internet company that connects buyers and sellers. Anaheim's draconian approach—banning room-sharing businesses—is unreasonable, but San Francisco's threatens the entire sharing economy.

The same city that can't fix its bureaucratic business registration process is going to fine and possibly jail employees of room-sharing companies for the actions of those who post rooms on their sites. Consider what it would mean if, say, Facebook were liable for anything any of its 1.6 billion users posted.

That's the basis of Airbnb's new lawsuit against the San Francisco law. As the company explains on its blog: "Since 1996, the Communications Decency Act—an important federal law referred to as the 'linchpin of the vibrant and successful internet we know today'—has prevented local governments from holding websites responsible for content published by their users as the city is attempting to do here."

Airbnb argues "the new law violates the federal Stored Communications Act, which creates uniform privacy protections for internet users and prevents cities from simply demanding that platforms turn over user information without a subpoena or other legal process." As the Hill reports, "Airbnb also alleges that San Francisco law violates federal privacy safeguards by requiring them to give up user information without a subpoena. The company is also raising a First Amendment claim that the law restricts speech."

The city said it is not punishing hosting platforms for users' posts. "In fact, it's not regulating user content at all—it's regulating the business activity of the hosting platform itself … It's simply a duty to verify information that's already required of a regulated business activity," according to a city statement published by TechCrunch. But verifying such information, in reality, means being responsible for users' content. Everyone in the new economy ought to hope Airbnb prevails here.

"It is ultimately about corporate responsibility," said Supervisor David Campos, as quoted in the San Francisco Chronicle. "About an industry that has made and continues to make tens of millions of dollars in this line of work taking responsibility for the negative impact that they are having on the housing stock."

It's nonsensical, but many San Francisco officials blame room-sharing platforms for the city's housing crisis. San Francisco has some of the nation's most-stringent housing regulations. The city and Bay Area communities make it enormously difficult to build new housing. Local regulations dramatically drive up the cost of building anything.

In 2014, KALW public radio reported "thousands of (possible rental) units are simply being kept off the market. Some estimate up to 10,000 of these units exist. Many sit unrented because tenants are proving too risky an investment for some property owners." Because of rent control and tenant laws, it's nearly impossible to get rid of a bad tenant. And tenants stay in the price-controlled, below-market apartments as long as they want to stay. Many owners would rather leave apartments vacant than find themselves in a scene from the horror movie "Pacific Heights."

STRs rarely comprise more than a small percentage of a city's housing stock. The problem is the lack of supply. Instead of cracking down on roomsharing, city officials ought to relax rent-control and land-use restrictions and permit more housing development of all types. Maybe San Francisco's leaders ought to stop attacking businesses and take a look at their own policies for a change.