Because of the expense, high rises are either offices or luxury homes. It doesn't make sense to build a 50 story flop house. Zoning also pushes you to build high rises in the neighborhood of other high rises, and land is expensive there. All in all, better to build a 6-12 story midrise flophouse in a cheaper part of town.
Also, from looking at the street view, and what a listing site said, it's pretty clear this particular 2 story building is pretty old (1919), and the neighboring buildings have been built up, but this one held out. Chances are, one day, a new, larger building will replace or subsume it. That's the circle of life, as happened to its neighbors.
[1] https://en.wikipedia.org/wiki/Millennium_Tower_(San_Francisc...
[2] https://en.wikipedia.org/wiki/List_of_tallest_buildings_in_S...
There's even a movie starring the Rock about it. (San Andreas)