I think the explanation given here is a bit muddy, so I’ll offer a clarification. As the wiki article linked by Todderbob states:
I don’t want to get into a huge standing discussion here, since it can be a fairly complex area of law. But I agree with Wiki here in that you don’t necessarily need to have suffered an actual injury to have standing. An “imminent” injury (which is necessarily one that hasn’t happened yet), can be enough to establish standing in many cases.
Here’s a Wiki link which discusses the various cases filed here. There have been a number of suits filed by individuals and organizations challenging the law. On a brief glance, nothing jumped out at me as preventing standing for these suits, but it’s for the court to decide.
This link appears to the the filing by the justice department in the case (warning PDF). Again, I only briefly glanced at it, but it looks like the Feds made the argument that they are suffering current injury (in addition to imminent injury). For example, one of the claims made was that the passage itself has already harmed US foreign relations. I didn’t go look up how the judge ruled on the claim. But there are a few of these types of passages in the pleading.