NYC government is high cost and plagued by unionization.
The MTA, for example, apparently has more management/support than they have actual engineers working to fix things. If you went to a public school, you would have definitely heard a good number of top teachers and administrators complaining about both the BoE and the teachers union.
NYC's system is much worse than you'd think, but they've had two business and efficiency mayors in charge, back-to-back, trying to fix these things.
SF isn't even a borough of NYC in comparison.