The city of San Francisco isn't some independent entity. It is made up of people, a lot of whom already own houses and/or don't want higher buildings and more neighbors and/or don't want to be in the business of building and managing housing. If you think about individual incentives rather than what is right and wrong then it makes perfect sense.