Russell Griffith, a deputy public defender in the Los Angeles crucible known as Compton, had strong words to describe the criminal justice system: “inhumane”, “stupid”, “insane”, and “completely screwed up”.

Seated on the eighth floor of Compton’s courthouse, his view obstructed by bulletproof glass, the veteran attorney let rip in an outspoken interview this week, denouncing a system in which he has worked for 25 years.

Griffith cast California’s network of police, courts and jails, the embodiment of the rule of law, as a cross between Kafka and Tom Wolfe’s novel The Bonfire of the Vanities, which he lauded as an accurate depiction of judicial dysfunction.

“Everyone has gone along with this big lie – our own version of the cheque is in the post,” said Griffith, who is paid by the state to represent those who cannot afford an attorney. “Everyone is part of this giant system that funds the machine – I’m including us, public defenders. We have all had our bread buttered by this. And it has been at the expense of generations of Latino and, above all, African American men.”

He was excoriating California’s draconian sentencing policies and America’s war on drugs, follies which produced needless mass incarceration, he said.

But during a tour of the courthouse, a 14-storey structure which towers over a landscape of gritty bungalows and discount stores, the public defender kept cracking a smile.

The reason was the legal thunderclap resounding through the corridors he considered a second home. “It’s a game changer,” said Griffith, 57. “In this job you lose most of the time. But now you actually have the law in your favour. It’s all gravy.”

He was referring to Proposition 47, a ballot initiative which Californians approved on 4 November in a rare victory for progressives on the day conservative Republicans swept congressional races across the US.

The measure reduces penalties for drug and other non-violent crimes, triggering instant releases for hundreds of inmates and shortening jail time for potentially tens of thousands of others. Combined with other reforms, it effectively ends America’s most notorious tough-on-crime experiment.

In 1994, California’s three-strikes law required courts to impose harsh sentences on habitual offenders. Dozens of other states subsequently adopted their own versions, fuelling an explosion in the US jail population, which grew from around 300,000 in 1986 to more than 2.4 million by 2014, rivaling China for the world’s highest incarceration rate. African Americans were jailed at nearly six times the rate of white people.

Compton, a poverty-stricken 10-square mile city of 97,000 souls in south LA, filled a disproportionate number of prison bunks. This, after all, was home to the rap group NWA, which scorched into popular culture with the double platinum album Straight Outta Compton, featuring tracks like Fuck Tha Police and Gangsta Gangsta. Bullet holes pockmarked the courthouse.

Griffith, paid by the state to defend clients who could not afford their own lawyers, watched the system flip from excessive lenience – in the 1970s you could kill and get just three years – to excessive harshness. “When three-strikes came in, that’s when everything became completely insane,” he said. “People were doing life for cases where no one died.”

Gun possession triggered ever-longer mandatory terms, regardless of whether the gun was unloaded and stuck in a waistband, or loaded and stuck in someone’s face. Possessing heroin or crack cocaine became a felony.

“It gave cops an enormously strong incentive to arrest people because they were cheap statistics,” Griffith said.

Police routinely testified that upon their approach, “startled” suspects “dropped” rocks of crack cocaine, a lie giving a legal pretext to search, said Griffith. “It kept the whole machinery going.”

Police got collars, courts got cases and prisons – which multiplied exponentially – got inmates. “These were largely victimless crimes. Incarcerating people on drugs charges is just absurd. But it was essentially funding the system.”

Carole Telfer, 60, another veteran public defender, said felony convictions condemned vulnerable people to unemployment and lack of federal assistance after lengthy terms inside. “It just ruins their life,” she said. “You can’t in good conscience handle all these cases and say it’s fair.”

Griffith called it a model of cooperation and camaraderie between clerks, prosecutors, public defenders, and judges. Wealthy areas like Torrance and Long Beach, in contrast, were more polarised and imposed heavier sentences. “Old white people sending a message: don’t come to our town or you’ll get screwed. Venue is everything.”

Both lawyers have been victims of crime. Griffith was badly beaten and robbed. Telfer had a shotgun pointed at her during a robbery. As citizens, they said they wanted dangerous people kept off the streets. Focusing on largely harmless drug users diverted police from chasing murderers, rapists, and child molesters, they said.

Both believe California’s lock-’em-up spree blurred the distinction between bad people and people who had done bad or stupid things. “Draconian sentencing seems inhumane. We’re saying this person is beyond redemption,” said Griffith.

Defence lawyers may be expected to say such things, but the nation’s top law-enforcer, attorney general Eric Holder, said much the same when changing federal jail policy last year.

California voters, fed up with huge prison bills and emboldened by low crime rates, also agree. In 2012, they approved proposition 36, which eased the three-strikes law, and earlier this month they approved proposition 47. It reclassifies common drug violations and certain thefts – about a quarter of all crimes - from potential felonies to misdemeanours. Inmates serving felony sentences for such offences have a three-year window to apply for reduced sentences.

An estimated 40,000 are eligible. In Compton, 115 have already been freed, with more due as the courts work through the backlog. Telfer is the designated attorney for such cases, which means continuous calls from clients and their relatives. Her phone rang about two dozen times while she spoke to the Guardian.

“We’re kind of inundated,” she said.

Prosecutors are unhappy. Jackie Lacey, the LA county district attorney, said in a phone interview she agreed with reclassifying minor offences as misdemeanours but said the new law created new problems.

A felony charge encouraged offenders to do drug rehab if offered as an alternative to jail, but a misdemeanour strips that incentive because county jails have no space for those charged with lesser offences. “Just a few minutes and they’re out. You have removed that leverage,” said Lacey.

The law also raises the hurdle for proving dangerousness, meaning prosecutors may struggle to keep violent offenders inside. “There are unintended consequences here,” she said. Even so, the DA pledged to apply the law as the will of the people.

Compton’s public defenders shared concerns about addicts skipping rehab and also about thieves feeling emboldened to steal goods valued up to $950, a misdemeanour.

But it was a small price, said Griffith, for correcting a system which jailed generations of essentially harmless people. “It’s a brave new world. We’re doing what we’re supposed to do: getting people out of custody who are supposed to be out of custody.”