One of the bills to watch in the closing weeks of the California Legislature’s current session would phase out private for-profit prisons in California. Gov. Jerry Brown vetoed a similar measure last year, but there are indications the timing might be right, both politically and pragmatically.

The bill’s author, Assemblyman Rob Bonta, D-Alameda, has cause for optimism. His AB32 sailed through the Assembly on a 61-13 vote and has cleared two Senate committees, Judiciary and Public Safety. Perhaps most consequentially, the concept was vigorously promoted by Gov. Gavin Newsom in his January inaugural address in which he vowed to “end the outrage that is private prisons in the state of California.”

About 2,400 state inmates remain housed in four private prisons.

The issue has gained additional momentum in the Democratic presidential primary, with candidates such as Kamala Harris, Elizabeth Warren and Bernie Sanders highlighting their objections to for-profit prisons.

Bonta’s concerns are both moral and fiscal. One is the lack of accountability. Private prisons are exempt from the federal Freedom of Information Act and the California Public Records Act. The occasional audits have found significant problems. For example, a recent federal report on three privately run immigration detention centers — including one in Adelanto, in San Bernardino County — identified squalid conditions and civil rights concerns.

Immigration detention facilities would be included in Bonta’s AB32.

Perhaps more than anything, the notion of inmates as commodities — instead of human beings who need to be rehabilitated to have a successful return to society — is Bonta’s concern with prisons run by companies whose first loyalty is to shareholders. The profit incentive encourages these enterprises to cut corners: in hiring standards, in security, in programs for education and training.

“A 2016 report from the Justice Department found that private prisons regularly failed to ensure adequate medical care for inmates, and reported more than twice as many inmate-on-staff assaults as in state-run prisons,” according to Bonta’s argument in the analysis sent to senators.

The state’s reliance on private prisons peaked a decade ago in response to an overcrowding crisis. Inmates were sent to lockups as far away as Oklahoma and Mississippi, an intolerable situation in view of studies that make clear that one of the keys to a prisoner’s successful re-entry is to retain relationships with family members. That distant warehousing has been phased out, thankfully, and now it’s time for the next step.

Under AB32, the state would be prohibited from initiating, renewing or expanding contracts with private prisons. All inmates would need to be moved out of facilities by Jan. 1, 2028. Some could be shifted to county jails, according to Bonta. The new law also would compel California, which with voter approval has been reducing sentences for less serious crimes, to further assess alternatives to mass incarceration.

The state Senate should give the governor a chance to make good on his pledge to end an outrage that is bad for taxpayers, bad for public safety and bad for social justice.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.