If a person gets accused of a crime and, like most Americans, cannot afford a lawyer, a public defender is often the only person standing between them and a cage. Most reasonable people would see incarceration as an unreasonably harsh outcome for stealing a shirt, let alone smoking a joint, but those are the breaks in much of the country. And the zealous advocates who could help prevent this are a threat to what our government tends to want.

A few weeks ago, Chief Public Defender Dean Beer and Deputy Chief Public Defender Keisha Hudson of Montgomery County, Pennsylvania filed an amicus brief in the local court that challenged its monetary bail system.

The cruel practice of monetary bail is slowly dying out, due to a new civil rights movement that calls it “poverty jailing.” When people get arrested, courts assign a pay-for-release amount that is often deliberately set higher than people can afford. Montgomery County doesn’t even require an attorney for the defendant to be present when that happens.

The three-person Montgomery County Board of Commissioners, unceremoniously fired Beer and Hudson on February 26. No reason was given, but Keir Bradford-Grey, a former head of Montgomery County public defender’s office who now holds that role in Philadelphia, said the timing “should alarm every public defender in the nation.”

In January, Minnesota, Hennepin County (Minneapolis) Public Defender Mary Moriarty was suspended under similar circumstances; the state chapter of the ACLU declared itself “deeply troubled” by that decision and stated, “No one should be fired for speaking truth to power.”

Representing impoverished defendants is the core role of the public defender. But the Supreme Court’s decision in Strickland v. Washington (1984) set the bar for competent representation miserably low. Filing an amicus brief challenging the constitutionality of cash bail is considered “above and beyond” the accepted level of advocacy. Beer and Hudson were just the kinds of people who cared enough to do it.

Public defenders, like elected prosecutors, have some discretion on how to discharge their duties. For example, they choose which defenses to bring forth at a jury trial, and which to abandon because they are not worth the risk of backlash from the court. With people’s constitutional rights at stake, they should be able to work unabated and unthreatened. Elected county commissioners should not be able to gut the leadership of a public defender’s office without providing an explanation.

So how can we grant public defenders the labor protections they so clearly need?

Elections for this office are extremely rare. According to law professor Ronald F. Wright, just four places in the US elect public defenders: San Francisco, California; Lancaster County (Lincoln), Nebraska; Davidson County (Nashville), Tennessee; and Florida.

It is easy to see why this role is democratically sidelined: Crime is a negative subject and serious crimes harm victims. Most public defenders will have heard some variant on the question: “How do you represent those people?”

More elections would be welcome, but deeper attitudinal problems are illustrated by what can happen in those rare places where public defenders are elected. In Jacksonville, Florida Matt Shirk became the chief public defender in 2008⁠—on the basis of a campaign promise to slash his own office’s budget. Shirk went on to sexually exploit his deputies at work and subsequently lost his re-election bid in 2016; were it not for his high-profile appearance in The Nation for his awful behavior, the chances are he would still be the elected public defender today.

Some states have a state-wide public defender board, which controls appointments and terminations, but that is not an adequate solution either. After all, Minnesota has that system, and Minneapolis’s Mary Moriarty was still canned by the State Board of Public Defense for criticizing pay disparities between defenders and prosecutors, as well as calling out racially offensive comments from another court professional.

Maybe what each state needs is a Defender General, a role pitched by law professors Daniel Epps and William Ortman in a new academic article. The Defender General could be a counterweight to the state’s Attorney General, and take on cases that have implications for defendants as a whole.

Under that system, Montgomery County public defenders would not have had the devil’s choice of letting their clients get jailed without representation for being too poor, or waiting in silence until a well-funded national nonprofit like the Civil Rights Corps came to save them.