There are some 50 story buildings. But cost increases pretty dramatically. Especially when you build on fill and mess up the foundation work [1]. There's a fairly consistent stream of tall buildings built over the years, not all of them are 50+ floors though [2]. There's gaps in building during economic distress, as you would expect.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...