The Justice Department argued that the lawsuit by 22 states was moot because the Trump administration recently rescinded its spending memo. The judge disagreed.