Making it easier to fire bad teachers isn’t going to magically cause the educational achievement gap to disappear. You need to be able to attract and retain more good teachers, too.

Unfortunately, no one wants to pay for that.

This week a California judge declared that tenure and other seniority rules that make it hard to dismiss teachers “result in grossly ineffective teachers obtaining and retaining permanent employment,” which hurts the low-income and minority children that low performers disproportionately teach. Almost exactly 60 years after Brown v. Board of Education, the California judge said that state statutes violate children’s constitutional right to equal educational opportunity. The decision looks likely to be appealed to the Supreme Court, and the plaintiffs’ lawyers said similar suits would soon be filed in other states.

Teachers’ unions, predictably, denounced the decision as further trampling on their noble profession. The Silicon Valley group that bankrolled the case hailed it as an unalloyed victory, one sure to give America’s poor and minority students access to better teachers. Both sides claim they are fighting for The Children. Who’s right?

Look, there do seem to be some obviously dumb things in California’s statutes. Teachers are being evaluated for tenure much too early — as soon as 18 months on the job, which research suggests is well before we actually know whether they’ll be effective for the long haul. As Dana Goldstein wrote in the Atlantic, even teachers themselves say, on average, that consideration for tenure should happen after 5.4 years of experience. (In most states, teachers are up for tenure after three to five years.) California’s “last in, first out” for layoffs also preserves the jobs of at least some bad apples.

But improving the quality of teachers who work with poor kids seems more about insufficient inflow of the talented than insufficient outflow of the untalented. One study, based on a policy change in Chicago, found that even when dismissal rules are relaxed, many principals still choose not to fire anyone — including at the worst-performing schools — perhaps at least partly because of the challenge of finding decent replacements.

Weakening job security in the absence of other reforms may even discourage good people from entering or sticking with the profession.

That’s because job security is one of the key forms of compensation that we still offer to educators as their salaries have gotten less competitive over time, thanks to a pesky combination of women’s lib and stingy taxpayers.

Think about it this way: Once upon a time, if you were a talented, educated, ambitious woman who wanted to work outside the home, few career options were available to you — basically teaching, nursing and not much else. Women’s opportunities have widened considerably over the past few decades, which of course is a very good thing. But this also means that teaching (still a predominantly female profession) is no longer the default path for America’s best and brightest women or, for that matter, for the best and brightest Americans of either gender. In the United States, only about a quarter of new teachers come from the top third of their college classes, and just 14 percent of those who end up in high-poverty schools.

In many ways, teaching has actually gotten objectively less attractive as a career. Public school teachers earn about as much today as they did 40 years ago in inflation-adjusted terms, while pay for college-educated, full-time workers overall has risen.

Part of the reason that teacher salaries have stagnated is that taxpayers are unwilling to shell out the dough required to give them raises today. So instead, politicians offer higher compensation tomorrow — funded by future taxpayers who can’t yet vote them out of office — in the form of more generous pensions. Which is where tenure becomes so important in retaining talent: The only way to credibly guarantee to teachers that they won’t get fired before their pensions vest is by giving them strong job protections.

Already, attrition among teachers is huge and increasing. An estimated 40 to 50 percent of educators nationwide leave the job within five years, and the most common level of experience for teachers is less than a full year. (In 1987, the modal teacher had 15 years of experience.) Given these trends among educators overall, just imagine how hard it is to get the most valuable talent to go to and then stay at the most challenging schools, which offer more troubled students, larger classes, greater leadership turnover, and more pressure to spend time teaching to highly scrutinized standardized tests.

Reducing job security may sound like a cheap way to improve teacher quality. But without some of the costlier changes necessary to make the most difficult teaching jobs more appealing to the most desirable workers, it seems unlikely to be the silver bullet school reformers are hoping for.