This doesn't explain everything, though. Using some back of the napkin math, a lot of money seems to be wasted in NYC (as someone who doesn't research education, though considering the state of the field I'm not sure that would help much). Imagine 10% of students need 1:1 teaching (think special needs) to be successful, while the other 90% need class sizes of 15 (gross underestimates to steelman the point). Also, imagine that 50% of costs go towards teacher labour (which may or may not be low), and that each teacher gets paid 120K a year.
Thus, the equation looks like: 2 * [0.1 * $120K + 0.9 * ($120K/15)] ~ 35K per year. This means that the NYC school system (which definitely does not have 15 kids per class, or 1:1 special needs education for 10% of students) is grossly inefficient.