“I had some reservations going in,” he said of Mr. Davies’s enterprise. “But the industry was exploding. Matt wanted to have internal controls in place. And we thought: This was a legitimate business. If the State of California deems it legitimate, we want to be the best at it.”

Mr. Davies’s accountant, David M. Silva, said he set up spreadsheets to keep track of inventories, revenues and expenses. “I’ve been a C.P.A. for 30 years,” Mr. Silva said. “What I saw was a guy who was trying to run an operation in an up-and-up way.”

The federal authorities said they stumbled across the operation after two men were spotted apparently breaking into Mr. Davies’s 30,000-square-foot Stockton warehouse. The police said they smelled marijuana plants. Federal agents conducted a raid and confiscated 1,962 plants and 200 pounds of marijuana.

Mr. Davies, who is free on $100,000 bail, greeted visitors to his gated home by asking them to speak softly while walking through the entryway so as not to awaken his sleeping infant. He called out to his wife when asked when he was indicted: “Hey, Molly — we were indicted on your birthday, right? July 18.”

Mr. Davies referred to marijuana as “medicine,” and himself as a turnaround expert.

“We were basically pharmacists for medical marijuana — everything was in full compliance with state law,” he said. “We paid our employees. We paid overtime. We had people going for unemployment if we fired them.”

“Why are they coming after me?” he asked. “If they have such a problem with California, why can’t they sue California?”

Stephanie Horton, 25, who went to work for Mr. Davies after going to one of his dispensaries to obtain medical marijuana to help her deal with ovarian and cervical cancer, said she was devastated by the arrest of employers she described as among the best she had ever had — not to mention the loss of her job.