A more likely culprit is the number of people walking around SF who pull down $350k+/yr, since they are willing and able to buy $17 salads, as well as overpriced real estate. It all comes down to the amount of money in flux in that location.
Restaurants (unless you are some michelin star joint) also don't really have the freedom to charge "whatever the customer is willing". Between rent, wages, and local competition, you can pretty much guarantee that there will be an average 10% profit margin in whatever area you are at.
IMO, the biggest culprit here is the astronomical rent prices charged to these places sucking out all of the extra capital gained by these 17$ salads
Literally everything you buy in SF costs more because the workers either have to afford a place in the city or have to make some crazy commute.
I own a 5-bedroom home on 1/2 acre - my mortgage is ~$570 before escrow, and ~$900 total.
However the cost of living does bring along a feeling that if life is this expensive why doesn't it feel or appear better.