The fact that New York had to answer the suit -- thus entering the adversarial phase -- with a motion to dismiss means that they had something they wanted to ask from the court, which the federal government contested. In this case, New York State won their motion to dismiss with prejudice, on the grounds that the federal government failed to state a claim.
All federal district courts are of limited jurisdiction, meaning they have to satisfy jurisdiction at the earliest onset. That the court is already looking into the sufficiency of the claims means that standing wasn't a barrier here. Indeed, the federal government -- if only they would competently follow the statute's requirements -- would definitely have standing. It's just that they had no case.
New York State made an ask (motion to dismiss) and got it with flying colors. This cannot be construed as anything but a successful defense. Aka, a win.