U.S. District Judge John Jones issued the order Wednesday in a suit brought by members of the Harrisburg City Council, Controller Dan Miller and Treasurer John Campbell.
Jones says the plaintiffs lack standing to pursue a claim that the 15-month-old law is unconstitutional because it violates equal-protection guarantees.
In particular, Jones questioned whether they had the authority to sue, and he noted the lawsuit lacks the approval of the City Council and Mayor Linda Thompson.
Jones also says the plaintiffs didn't show they have been harmed, and he suggests state courts are a better avenue for the lawsuit.
He previously dismissed a legal challenge by three city residents.