Most people in NYC rent, and there are many other considerations to make when picking an apartment to move into besides what kind of stove it has. You're often taking what you can get. This law will mean that, going forward, there will be more apartments available that don't have air-quality-destroying gas stoves, meaning there'll be more suitable places for people to pick from.
Also, as the other commenter said, these are apartment buildings. If you burn your apartment down it's gonna affect your neighbors. If you mess up your indoor air quality it's gonna affect your neighbors.