A developer wanted to replace parking garages with affordable apartments in Manhattan, but some residents on the Upper West Side resisted. Here’s why the housing won.