A U.S. District Court judge ruled the legislation exceeds the powers granted to it by the Constitution.