Generally speaking, improving the tax base of a city should improve education and health care. It doesn't in San Francisco because the city is mismanaged: it spends integer multiples per capita compared to other cities.
Meanwhile, housing is expensive in San Francisco because San Francisco makes it difficult to build high-density housing, which it badly needs, because unlike Chicago San Francisco can't grow "out".
When Wicker Park was gentrified in Chicago, residents got angry, but then they moved to adjoining neighborhoods. It's possible that many of them kept their kids in the same schools; virtually all of them kept their kids in the same school system. Chicago in 2013 could sustain at least 3 more waves of gentrification, waves that would turn Garfield Park into yuppie restaurant districts, without displacing residents outside of the city boundaries.
San Francisco can't do that. Where Chicago has Garfield Park, then Lawndale, then Austin, then a border with a suburb, San Francisco has cold brackish water. When a working class resident of San Francisco loses their apartment, there's a good chance they're not going to be able to remain in the city at all! That makes gentrification in San Francisco far more painful than it is in other cities.
There's a solution to this problem, which is to sacrifice some of the postcard beauty of Bayview and the Tenderloin to allow high-density housing. But for reasons other people have described on this thread, the residents of San Francisco are unwilling to do that. So they suffer, and then scapegoat.