Like an aging actor who keeps coming back onstage for just one more curtain call, New York's Rockefeller drug laws have somehow hung around for years past their sell-by date. Earlier this week, New York's political leaders finally dropped the curtain, closing out an era of drug policy that I believe historians will one day look back on in horror and also considerable bemusement.

The laws were passed in New York state in the early 1970s, at the urging of governor Nelson Rockefeller, during a popular panic about a growing heroin epidemic. They locked into place rigid mandatory sentences for relatively low-end drug crimes and, over the years, they were responsible for large numbers of impoverished young men and women from New York ghettos and barrios receiving decades-long prison sentences for crimes involving small amounts of heroin and cocaine that at other moments in time, or other locations, would have merited at most a few years behind bars.

In essence, they imposed the sorts of draconian sentences on drug-economy foot soldiers – unemployed teenagers, girlfriends dragooned by their boyfriends into carrying a drug package, addicts selling small quantities to fund their own habits – that had previously only been imposed on smuggling kingpins.

In the early 1970s, many criminologists believed that rehabilitation programmes generally didn't lower crime rates and drug usage – a famous study of New York state programmes by a sociology professor named Robert Martinson had starkly concluded that "nothing works". The public was growing weary of social disorder and mushrooming drug subcultures. And many criminals were cycling through the courts numerous times before being sentenced to prison, giving rise to the idea that liberal judges were handing out free passes to miscreants.

In such a context, laws like those championed by Rockefeller, however heavy-handed and clumsy they might have been, served some purpose. Or, at the very least, one could generate political rationales for their passage. Sure, they resulted in New York's prison system being flooded with tens of thousands of low-level offenders. Sure, the costs were prohibitive. But at least politicians could respond to their constituents' concerns by saying something was being done.

Nearly 40 years on, however, their continued implementation makes absolutely no sense. Much recent research has indicated that carefully tailored rehabilitation and non-prison-based programming for drug offenders does, or at least can, work – and at a fraction of the cost of incarcerating those same individuals. Groups such as the Fortune Society in New York have shown that intensive, often residential, intervention work with addicts can reduce both their usage of narcotics and the accompanying crime rate and social instability.

Somewhat parallel to this, after years of broad popular support for expensive "tough on crime" policies, in recent years the American public has grown weary of spending tens of billions of dollars per year locking up non-violent offenders, throwing good money after bad in a futile game of catch-up with drug distribution networks. Hence the passage of initiatives such as Proposition 36 in California, which divert many drug criminals into treatment programmes in the community.

Moreover, too many stories have been told – by journalists such as the Village Voice's Jennifer Gonnerman and others – of lives destroyed by implementation of the Rockefeller laws and similar state statutes around the country for criminal justice theorists to still plausibly claim that such laws are fair and proportionate.

In her 2004 book Life on the Outside, Gonnerman chronicled the story of Elaine Bartlett, a woman sentenced to 20-years-to-life for a single cocaine sale. Bartlett's sentence was commuted after she had spent 16 years behind bars, but by then the damage was done. She was a middle-aged woman whose family bonds had been shattered by prison, who had no long-term job prospects and whose access to government programmes was strictly limited because of her felony record. Her freedom was a limited one, circumscribed by a damaged psyche and a myriad of social handicaps that were part of the legacy of nearly two decades spent behind bars.

Anyone who read this book would realise how futile, how counter-productive, legislation such as the Rockefeller drug laws actually is. If the aim is to better lives and produce safer communities, removing judicial discretion and imposing one-size-fits-all mandatory sentences is exactly the wrong way to go about things.

For at least a decade, a consensus has been developing around the need to scrap the Rockefeller laws. Little by little, they have been scaled back, and yet the core principle has survived.

Now, finally, New York is about to lay this misguided package of laws to rest. State legislators and governor David Paterson have reached an agreement that would end the mandatory sentencing codes, allow a couple thousand prisoners to apply for sentence reductions and channel thousands of non-violent drug offenders into treatment programmes.

At long last, it looks as if the decrepit actor has taken his final bow. Nearly 40 years after the Rockefeller laws launched America down the disastrous road to wholesale incarceration, a more sensible and nuanced approach to drug sentencing is starting to take centre stage.