The law seems to be pretty unambiguous:
According to the lawsuit, the shift violates a string of constitutional amendments approved by voters. Proposition 116, which voters passed in 1990, established the Public Transportation Account funded by motor fuel sales tax. The state was directed to use the money "only for transportation planning and mass transportation purposes," and subsequent propositions reinforced the account.
The Legislative Analyst's Office had warned that parts of the accounting move were legally unworkable.
As a side point, I notice that this Bee article repeats a statement I've seen many times in the press, which is just plain not true:
The account, which is partly funded by the sales tax on diesel fuel and gasoline, has been flush with cash because of high gas prices.
The California gas tax is a straight 18¢ per gallon, not a percentage of sales price, as this graphic from the state energy department makes clear:
So if gas tax revenues are increasing, it's got nothing to do with the cost of gas, just that people are using more of it--indicating an increased demand for transportation, which can reasonably imply an increased need for transit. This is more a technical point than a political one, but c'mon, get your facts right!