California unions whose members depend on the state budget for their salaries celebrated last week when Gov. Gavin Newsom signed legislation aimed at plugging corporate tax loopholes.

“Giant, highly profitable, global corporations often pay less in California taxes than a social worker or a teacher,” Arnulfo De La Cruz, president of the Service Employees International Union, said in a statement. “That makes no sense at all, and we’re going to change that. Accountability for corporate tax credits is long overdue.

“Every year, caregivers, social workers, child care providers and state workers have to fight to justify funding for the vital work we do; yet, corporations walk away with billions in tax dollars and never have to justify a penny of it.”

Senate Bill 1349, sponsored by SEIU and other unions and carried by state Sen. Lena Gonzalez, a Long Beach Democrat, orders the Legislative Analyst’s Office to study major “tax expenditures,” the official name for tax laws that favor certain classes of taxpayers. The LAO would recommend changes or repeals of those that it deems to be cost-ineffective.

It’s the latest wrinkle in a yearslong political debate over whether tax laws should be used to subsidize specific economic sectors, thereby reducing revenue that could have been used for public services. But it’s tinged in irony.

The Department of Finance already publishes an annual report on tax expenditures, the latest of which indicates that they cost the state budget about $100 billion a year, with $76 billion of that from personal income taxes.

Corporate tax expenditures, the obvious target of SB 1349, are a relatively small $8.2 billion, including a series of tax credits for Southern California’s film and TV production industry. In fact, the Democratic legislators who sent SB 1349 to Newsom’s desk also voted for two bills that expand the credits the industry says are needed to prevent production from fleeing to other states.

Moreover, the vast majority of the loopholes in the finance department report were enacted during the last 60 years when Democrats dominated the Capitol. If SEIU and other advocates of closing them are looking for villains, they needn’t go far.

The history of one relatively tiny tax expenditure, enacted nearly 40 years ago, illustrates the irrational nature of tax policy.

While purchasers of off-the-shelf computer software on optical discs, such as the Quicken personal finance program, must pay sales taxes, custom software purchased by corporations is tax-free, thanks to a bill passed nearly 40 years ago.

The measure was sponsored by custom software makers and carried by a legislator from Silicon Valley. The finance department says it costs state and local governments $56 million a year.

Software delivered or accessed electronically, rather than physically, also has been tax-free, regardless of who is buying it. This year, the Legislature erased that loophole for “prewritten” software that individuals download, but didn’t touch the loophole for custom software. It also continued to exempt downloaded music, movies and games.

Taxing downloaded software is estimated to increase state revenue — and cost consumers — about $1 billion a year.

Unwarranted loopholes, such as the custom software tax exemption or the film industry tax credits, are welfare for the wealthy and should be closed as a matter of equity.

However, the tax expenditures with the largest price tags, such as the sales tax exemptions for food and drugs, the exclusion of employers’ healthcare and pension contributions from income taxes, or the deduction of mortgage interest are also those with the broadest popular support.

It’s highly doubtful that SB 1349 will produce the cornucopia of revenues its sponsors seek.

Dan Walters is one of most decorated and widely syndicated columnists in California history, authoring a column four times a week that offers his view and analysis of the state’s political, economic,...