A federal judge in northern California ruled that the U.S. Defense Department's sanctioning of AI firm Anthropic as a security risk was unlawful.