“There is a significant legal distinction between stealing documents and disclosing documents that someone else had stolen previously,” Judge Koeltl wrote. Like a news outlet, he said, WikiLeaks could not be held liable for releasing the documents so long as it did not “participate in any wrongdoing in obtaining the materials in the first place.”

The judge’s ruling came several months after the special counsel, Robert S. Mueller III, concluded his investigation into Russia’s interference in the 2016 election. The inquiry did not find evidence to establish a conspiracy between the Trump campaign and Russia’s effort to influence the election results.

Judge Koeltl said that the national committee’s accusations were “totally divorced” from the facts asserted in the organization’s own complaint — wording that Mr. Trump seized on in a Twitter post on Tuesday night. Nonetheless, the judge refused the Trump campaign’s request to penalize the national committee for filing the lawsuit last year. He said the complaint was not “so objectively unreasonable” that the plaintiffs should be disciplined for it.