The law would have granted New York's more than 800,000 legal noncitizens the right to vote in city elections beginning next year.