A federal judge said President Trump’s federal housing director cannot be held liable in court under a decades-old law.