Judge Snow said he was troubled — by both the investigation and what it had produced.

“The court wonders why, when the M.C.S.O. should have been spending their time, money and resources in implementing its order, they were funding a confidential informant as well as three M.C.S.O. deputies or posse members to be in Seattle, Wash., accruing overtime, travel and salary expenses, as well as significant technology costs, attempting to construct some bogus conspiracy theory to discredit this court,” Judge Snow said in court, referring to the sheriff’s office.

He took to referring to the investigation as the “Seattle operation” and sounded skeptical when describing the reasoning and results of Mr. Montgomery’s work. He said Mr. Montgomery had “allegedly” used information “harvested by the C.I.A. and confiscated by him” when he was a government software contractor.

The materials, the judge said, included fragments of email messages between the Justice Department and a former clerk of Judge Snow’s, as well as snippets of phone calls Mr. Montgomery claimed to have tracked between Judge Snow and the former attorney general, Eric H. Holder Jr., as well as with other high-ranking Justice Department officials.

On the stand, Deputy Sheridan said Mr. Montgomery had “pulled data from American citizens for the C.I.A.,” an assertion that the agency has denied.

When Judge Snow suggested that the materials provided by Mr. Montgomery were “junk,” Deputy Sheridan and Sheriff Arpaio agreed.

But the tale of the conspiracy has nonetheless reverberated from the glass-and-steel Sandra Day O’Connor United States Courthouse here to the halls of the Justice Department and the Pentagon. Last month, Judge Snow asked Michele M. Iafrate, who is representing Sheriff Arpaio in the civil contempt case, to write to the C.I.A., informing it that her client may be in possession of some of its materials.

The cache is also said to include bank account numbers and balances for about 50,000 residents of Maricopa County, Deputy Sheridan told Judge Snow.