There is a right to a quality education In CA's constitution. Also there must not be disparities between rich and poor, black and white, etc.
The lawsuit claimed that poor, minority students were disproportionately damaged by last-in first-out layoffs and early teacher tenure because newer teachers will take jobs in low income schools. So when they have to cut heads district-wide, poor schools get hit hardest. They can't lay off the worst teacher in the district, only the newest one.
The plaintiffs pounded home the message that ineffective teachers harm students, and ineffective teachers are prohibitively hard to dismiss due to 5 specific job-protections enshrined in CA law, and poor students are much more likely to be stuck with an ineffective teacher.