SACRAMENTO — A judge ruled Wednesday that Secretary of State Debra Bowen erred by deciding that tens of thousands of criminals who are serving sentences under community supervision are ineligible to vote.

The ruling stemmed from the state’s three-year-old criminal justice realignment law, which is reducing overcrowding in state prisons by sentencing people convicted of less serious crimes to county jails or alternative treatment programs.

The American Civil Liberties Union and other groups sued on behalf of nearly 60,000 convicts who previously would have been ineligible to vote because they were on state parole.

Under realignment, however, they are now sentenced either to mandatory supervision or post-release community supervision. Bowen’s legal analysis said that was “functionally equivalent” to parole.