In the jargon of the Capitol, “trailer bills” are measures that accompany the annual state budget – in theory making the changes of law necessary to implement the budget’s fiscal policies.

In practice, they serve another, much different function – to sneakily do things that might otherwise be difficult to do if they were fully exposed in advance to the public.

Because trailer bills are considered part of the budget, they can be enacted with simple majority legislative votes and take effect immediately upon being signed by the governor, thus protecting them from being challenged via the referendum process that would give voters the final word.

The blatant misuse of trailer bills, making them into political Christmas trees festooned with ornamental favors to interest groups, finally sparked a ballot measure that requires them to be in print for 72 hours before final passage votes. But that has only slowed their misuse, not prevented it.

A case in point is Senate Bill 861, which whipped through the Legislature in a few days last August. It was an attempt to legalize a $331 million diversion of funds away from distressed homeowners after the diversion was declared illegal by the courts.

In 2012, the federal government and 49 states, including California, settled a massive suit against the nation’s five largest home mortgage servicers, alleging mishandling of home loans that contributed to the nationwide financial crisis a few years earlier.

California received $410 million, most of which was supposed to be used to relieve the financial impacts on homeowners.

However, Jerry Brown had just become governor when the cash arrived in Sacramento and he was coping with a massive budget deficit that resulted from the financial crisis. So one of the steps he and the Legislature took to balance the general fund budget was to divert $331 million from the settlement into repaying existing housing bonds and offsetting some expenditures in the Department of Justice.

The diversion sparked a lawsuit from consumer advocacy groups, alleging that the money was not being used as intended and ever since it’s been winding slowly through the courts with the state consistently losing.

SB 861, drafted and passed while the dispute was before the state Supreme Court, was an effort by Brown and legislators to stop their losing streak. It would, essentially, declare that the diversion was legal. However, it just generated another judicial slap-down.

Early this month, three justices of the Sacramento-based 3rd District Court of Appeal ruled that the legislation still doesn’t make the diversion legal and ordered the state to use the $331 million for its intended purposes.

Jerry Brown’s name is no longer on the lawsuit because he’s been succeeded by Gavin Newsom, who’s now the defendant and was ordered by the appellate court “to retransfer from the General Fund to the National Mortgage Settlement Deposit Fund the sum of $331,044,084.”

Newsom could appeal to the state Supreme Court, but likely would lose. An appeal, asking legal permission for the state to stiff consumers, would also be bad political optics.

The lessons Newsom should take from this case are to use the money as intended, to help distressed homeowners, not underwrite the state budget, and stop misusing budget trailer bills. But don’t count on that outcome. New trailers are already being drafted for the new budget cycle.