THE FISCAL WOUNDS inflicted on local governments during the Great Recession have barely begun to heal, but already politicians in Montgomery County seem intent on taking a stroll down memory-impaired lane. They are poised to pump up per capita spending on public schools even though state law all but ensures that any such increase will be irrevocable — in perpetuity. That state law, enacted in 2012 at the behest of the teachers union, means that any good budgetary deed by the county will be punished in the next economic downturn. How soon county officials forget.

It was just a few years ago that Montgomery County, its budget depleted by the recession, ran afoul of state rules forbidding any cuts in per capita school funding. The county appealed and eventually prevailed, modestly trimming spending on public education even as it made much steeper reductions for libraries, parks and transportation. Then the teachers union flexed its muscle in Annapolis— and struck back.

The measure they pushed through, with the help of pandering lawmakers, is a model of how fiscal prudence is warped by special-interest politics. It enables the state to seize local income tax revenue, and override local limits on property taxes, in the event a county reduces per capita schools spending — even if the county has vastly exceeded minimum spending levels in previous years, as Montgomery did from 2001 to 2009.

Securing a waiver to protect the county from the law’s effects is technically feasible but, in the real world, all but impossible in political terms. When the next recession strikes, the ill-advised state law will render Montgomery, the state’s biggest and richest jurisdiction, helpless to balance competing budgetary demands.

Wary of locking in per capita funding increases forever, county officials have said for the past couple of years that they are loath to exceed state-mandated minimum spending on schools — already sky-high thanks to the county’s past generosity. But this is an election year, the economy is recovering, tax revenue is rising — and memories are fading.

Under pressure from the schools and teachers as he campaigns for reelection, County Executive Isiah Leggett (D) has proposed a budget for fiscal 2015 that would shift $26 million more to the public schools than required by the state’s so-called maintenance of effort law. In the context of a $2.1 billion county schools budget, this is not a spectacular sum. It’s just half the $52 million increase requested by the schools above the state-mandated minimum. Still, it elevates the county’s per capita spending on public education and, thanks to the state law, locks it in even in the event of future calamity.

It may well be that the school system’s budget request, or at least Mr. Leggett’s own recommendation, is amply justified. The county’s excellent schools are adjusting to rapidly shifting demographics and soaring enrollment. The problem is that the senseless state law allows for no flexibility in the future. It’s not a question of whether the county will regret its generosity. It’s simply a question of when.