Can a lawyer work too hard to defend a client? That all depends on who is paying the bill, a new lawsuit argues.

A criminal defense lawyer in Galveston, Tex., says he was pulled off cases defending poor clients because he spent too much time on them and requested funds to have their charges investigated.

Needless to say, his clients were not the ones complaining. Instead, it was the judge, Jack Ewing, who appoints lawyers for those in his courtroom who cannot afford them.

“You overwork cases,” Judge Ewing told the lawyer, Drew Willey, according to excerpts from a recorded conversation cited in the lawsuit.

Though an estimated four of every five criminal defendants in the United States use court-appointed lawyers or public defenders, many of the nation’s indigent defense systems have been criticized as desperately inadequate, leading to false guilty pleas and overincarceration.

Lawyers who represent the poor can be required to juggle hundreds of cases at a time, accept pay far lower than the market rate, or take cases for which they have little experience.

This new case, though, exposes another potential problem: Indigent defense lawyers often get their assignments from the judges in whose courtroom they appear. This discourages a robust defense, experts say, and leads to an emphasis on resolving cases quickly.

The tensions may be familiar to lawyers, but they are rarely so candidly aired as in this lawsuit, filed in federal court last week and bolstered by parts of a recorded conversation with the judge.

Mr. Willey’s lawyer, Charlie Gerstein of Civil Rights Corps, a nonprofit organization in Washington, D.C., said the lawsuit would be the first in a series of cases and was filed partly to illustrate a “phenomenon that pervades the entire legal system.”

The lawsuit contends that Judge Ewing took away some of Mr. Willey’s poor clients and refused to appoint him new ones because “he sought to provide a vigorous legal and factual defense for his clients.”

Mr. Willey said he has been appointed to only one case before Judge Ewing since May 2016, and that appointment was effectively made by another judge. The lawsuit asks for him to be reinstated and for Judge Ewing to be barred from retaliating against him.

In an interview, Judge Ewing denied the allegations, saying he assigned some cases to another lawyer because many of Mr. Willey’s cases were unresolved and Mr. Willey seemed overwhelmed. He also said that, as far as he knows, Mr. Willey’s eligibility to represent indigent defendants has never changed.

But according to the lawsuit, Judge Ewing told Mr. Willey that he spent too much time defending individual clients.

“You are the only attorney” to routinely ask for a paid investigator, the judge said. He also complained that cases resulting in guilty pleas generally should not take more than three hours of work, but Mr. Willey sometimes took longer.

Relatively few criminal cases ever go to trial; most end instead in guilty pleas. But that does not mean that time and money is spent on them in vain. The length of the sentence offered in a plea bargain can hinge on the strength of the prosecution’s case, and a thorough evaluation of the evidence can put defense lawyers in a stronger negotiating position.

Mr. Willey’s lawsuit offered the example of a client charged with breaking into a car. The client faced up to a year in jail, but Mr. Willey found “blatant inconsistencies” in police statements. When prosecutors declined to reduce the charge, he hired an investigator, the lawsuit says.

Ultimately the client was allowed to plead guilty to criminal mischief, the lowest class of misdemeanor, which carried no possible jail time and was eligible for expungement from his record, Mr. Willey said.

Yet Judge Ewing cut Mr. Willey’s request for $1,320 in pay on the case to $511, citing “excessive out-of-court hours,” according to the lawsuit. After Mr. Willey appealed, another judge approved the full amount.

A 2011 RAND Corporation study of more than 3,000 Philadelphia murder cases found that clients fared better when they were represented by a lawyer from an independent public defender organization than if they had one appointed by a judge: Their conviction rate was 19 percent lower; the chances that they would serve a life sentence were reduced by 62 percent; and their expected sentence length was 24 percent shorter.

And, experts say, that gives lawyers reason to push for a fast resolution, skipping thorough investigations or motions that might slow the docket or displease the judge. Some defense lawyers also fear that if they object too strenuously, their clients will be penalized.

“Public defense providers internalize, and try to figure out what it takes to get the next contract,” said David Carroll, executive director of the Sixth Amendment Center, a nonpartisan group that provides technical assistance on criminal justice matters to state and local policymakers. “A judge doesn’t actually have to say, ‘Don’t file any motions in my courtroom.’”

In a survey commissioned by the Texas bar in 2000, nearly half of the criminal court judges in Texas said that a lawyer’s “reputation for moving cases, regardless of the quality of defense” was sometimes or usually a factor in appointment decisions made by their peers.

Mr. Willey, four years out of law school, represents clients in misdemeanor and felony cases. Judge Ewing said Mr. Willey’s “inexperience leads him to tend to charge more hours than what normally would be approved.”

He recalled his conversations with Mr. Willey differently from how they are described in the lawsuit.

“I think I said, ‘I can’t be paying you five times or six times an attorney with 20 years’ more experience,’” Judge Ewing said. He added that he had reduced pay requests he deemed excessive from other lawyers as well.

Galveston County, Judge Ewing added, has safeguards to ensure defendants have lawyers with experience commensurate with the severity of charges they face.

“We are giving people the best representation they can get if they are indigent,” he said. “If that is truly Mr. Willey’s goal, then I’d say we have something in common.”

A version of this article appears in print on , on Page A10 of the New York edition with the headline: Preferring a Quick Guilty Plea to a More Thorough Defense. Order Reprints | Today’s Paper | Subscribe