The judge (Lewis Kaplan) said the actions that precipitated the suit—Trump’s recent denials of Carroll’s rape claims from the 1990s—were not related to Trump’s job as president and did not amount to official business. Kaplan also said the president was not covered by the law the Justice Department wielded to jump into the case.
The judge ruled that he could find no cases indicating that the president enjoyed the same protections that other federal employees enjoy, and that he could not conceivably construe Trump's statements about Carroll and an event that occurred decades before his presidency as falling within the scope of his position as president.
Outside the scope of this particular legal question, Carroll's attorneys report that she has a dress with DNA from the alleged rape. Her attorneys are demanding a DNA sample from Trump. I wonder if they've gone to Trump's niece for a sample, which would rule Trump out or narrow the list of possible depositors of the DNA sample to a very small number of men including Donald Trump.