Tenure laws that provide job security for 277,000 California schoolteachers were preserved Monday when a divided state Supreme Court rejected a challenge by opponents who said the laws shielded incompetent instructors and harmed low-income and minority students.

The 4-3 vote was a victory for teachers and their unions, who argued that tenure was essential to protect teachers from arbitrary and politically motivated firings and that there was no evidence the job-security laws have damaged public education in California.

“When teachers feel protected, they can stand up for their students,” said Eric Heins, president of the state’s largest teachers’ union, the California Teachers Association. “It’s a good day for students and for educators.”

Opponents said they would keep pressing for changes in the laws.

“Californians will continue to demand that the state address the massive and inexcusable inequality in access to quality teachers in our public schools,” said David Welch, the Silicon Valley entrepreneur who funded the suit by nine students. He said the court case had cast “a much-needed spotlight on these shameful laws and the enormous harm they inflict on thousands of children every year.”

The court’s vote left intact an appellate ruling that upheld the tenure laws after a Los Angeles judge struck them down. In an unprecedented 2014 ruling, the judge found that teacher tenure and seniority rules violated students’ right to an equal education.

In a separate 4-3 vote Monday, the Supreme Court also refused to take up the issue of school funding in California, which ranks near the bottom of the states in educational spending and test scores.

Teachers’ groups and school district officials argued that state education spending was so low that it violated the California Constitution’s guarantee of a public education, and required the courts to step in, as courts in many other states have done. But the justices denied review of an appellate court decision that said the Constitution does not give students the right to an education of any particular level of quality or funding.

Dissenting justices in both cases said the issues affected millions of public school students and should be decided by the state’s top court.

“The schoolchildren of California deserve to know whether their fundamental right to an education is a paper promise or a real guarantee,” Justice Goodwin Liu wrote in the school funding case. He and Justices Mariano-Florentino Cuéllar and Ming Chin said the court should have taken up both cases, one short of the majority needed for review.

Chief Justice Tani Cantil-Sakauye and Justices Kathryn Mickle Werdegar, Carol Corrigan and Leondra Kruger voted against Supreme Court review.

The tenure laws allow schools to fire teachers for any reason in their first two years, but require “good cause” for dismissals after that.

Nearly every state grants tenure to teachers, but California is one of only five that provide the protections after two years. Most states have a three-year probation period, and some have four or five years.

Supporters of tenure say the laws protect teachers from arbitrary dismissals, strengthen academic freedom, and attract high-quality candidates for high-stress, relatively low-paid work that is vital to the community. Opponents said they were not challenging all tenure laws, but contended that two years was not enough time for a meaningful evaluation, particularly since, as an administrator testified, practicalities required an assessment to be completed by March of a teacher’s second year.

Their suit also challenged the “last hired, first fired” laws that require school districts to follow seniority during layoffs and dismiss the least-senior teachers first, with exceptions for those with needed and specialized skills.

In June 2014, Los Angeles Superior Court Judge Rolf Treu declared both laws unconstitutional, the first ruling of its kind in the nation. He said the laws make it prohibitively time-consuming and expensive to remove incompetent teachers.

Citing testimony from an eight-week trial, Treu said two years is not enough time to evaluate a teacher properly, and as a result, “grossly ineffective” teachers are assigned too often to schools with large numbers of poor or minority students. He said the seniority laws require schools to ignore teacher quality and base layoffs entirely on years of experience.

The result, Treu said, is a violation of students’ constitutional right to “equality of education.”

But the state’s Second District Court of Appeal overruled Treu in April and said the judge had failed to cite any evidence that tenure or seniority laws were to blame for substandard education.

“The challenged statutes do not inevitably lead to the assignment of more inexperienced teachers to schools serving poor and minority students,” Presiding Justice Roger Boren said in the 3-0 ruling.

Some teachers protected by the laws may turn out to be ineffective, Boren said, but school officials determine where those teachers are assigned, and overturning the laws would not affect their decisions or the quality of education at needy schools.

In seeking state Supreme Court review, opponents of the tenure laws said the appeals court should have accepted the findings of the trial judge, who had heard the evidence firsthand.

In a pair of unusually lengthy and detailed dissents Monday from the court’s decision not to review, Liu and Cuéllar said there was strong evidence that the two-year period for tenure assessment, and the time and expense needed to fire tenured teachers, result in protections for weak instructors who inflict lasting harm on their students.

The justices also said the court should have taken up a case that charged that California’s paltry level of financing for public education violates students’ constitutional rights.

The plaintiff in that case — including the San Francisco and Alameda school districts, seven other local districts, the California Teachers Association and the State PTA — said California trails virtually every other state in per-pupil spending, school staffing and test scores, a status it has held since shortly after the Proposition 13 property tax cut of 1978.

They argued that the California Constitution, which since 1879 has required a public school system that encourages “the promotion of intellectual ... improvement,” gave students a right to an education of at least some minimal level of quality.

Six days after the appellate ruling on tenure, the First District Court of Appeal in San Francisco rejected their arguments.

The appeals court ruled 2-1 that the California Constitution does not require the state to fund schools at any particular level, regardless of the impact on education.

The constitutional provisions “leave the difficult and policy-laden question associated with educational adequacy and funding to the legislative branch,” not the courts, Justice Martin Jenkins said in the majority opinion.

By letting the appeals court decision stand, attorney John Affeldt of the nonprofit Public Advocates law firm said Monday, the high court affirmed that “there’s no meaningful quality owed to our students under our Constitution.”

The tenure case is Vergara vs. California, S234741. The school funding case is Campaign for Quality Education vs. California,S234901.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com

Twitter: @egelko

The opinions

The dissenting opinions in the tenure case can be viewed here: http://bit.ly/2bQ2QG5

The dissenting opinions in the school funding case can be viewed here: http://bit.ly/2bQ2MpT