That's a peripheral reason.
The fundamental reason is geography, which both limits the supply available real estate near the core of the City, increases the for real estate in the City, and makes it expensive to build travel conduits to reduce the travel time of commute-suitable housing outside the city.
But yet its real estate availability is much higher than SF, and its commutable feeder cities/suburbs are innumerable.
The fundamental problem is political. San Francisco is a desirable place to live - tech industry or otherwise - but everyone wants in, and once they get in, they do everything in their power to ensure no one else gets in. It is literally the most development-hostile city I've ever seen.
San Francisco is expensive because San Franciscans would rather starve, see people evicted, see an exodus of the people and culture that made the city famous, suffer incredible transportation problems, etc etc, than lose a single dainty Victorian house on their street.
Forget sustainable development. Forget development that aligns to existing neighborhood characteristics. Politically speaking, the only development plan on the table in SF is no development whatsoever.
Not all of them on the demand side (e.g., climate.)
And even if everything else was the same, rent control wouldn't explain the difference, because Manhattan has that, too.
There's rent regulation, which is closer to what SF calls rent control, but even the proportion of regulated apartments in NYC is much lower than in SF. SF's rent control is based on year of construction, and due to the construction-hostile politics of modern SF, that means a lot of units in SF are controlled.
NYC on the other hand has a lot more new construction which aren't regulated, and even the regulated apartments are steadily falling out of regulation (this was intentional - unlike SF, rent regulation is a mechanism to prevent sudden price fluctuations, not a permanent means to suppress rent).
The rent control situation in NYC is very different from the situation in SF.
I think what everyone really notices is the exorbitant rent prices in "the city". The reason for that is rent control and subsidized housing which artificially lowers the supply of housing thus raising prices. I am techie living in a crappy part of SF in a crappy building since I don't want to pay half my salary in rent. Across from me is a Mercy housing complex with an income limit of 30k. They enjoy large rooms, views and cheaper rent than me but no blames pricing on that. Its all the techies fault for bringing income and demand to "the city".