Truisms from the outside.
Problem #1 public school students are taught by government employees (and the schools are administered by government employees). This means that at most, 20% of them are competent and diligent. 20% are doing everything imaginable to avoid work, and the remaining 60% are just putting in time in anticipation of their early retirement. This is true for ALL government agencies. It is the nature of the animal, and the nature of those who are "called" to work there. With a few exceptions, tf they had any ambition, they would not be working for the government.
Problem #2 is teachers' unions. They are anti-productive when it comes to education. They work to maximize teachers' compensation and benefits, protect the worst performers, and limit the amount of actual work that teachers do. Never forget that the teachers' unions sabotaged all of American public education during the pandemic, and were never called on it. The whole school system lost a year or two of education for no good reason, and it was the fault of the teachers' unions. They are just like every other labor union (NOT craft unions or professional unions). Unfortunately, unlike American businesses, we can't just shut them down and move them off shore.
Problem #3 is the ACLU and its fellow travelers, who have introduced, successfully, the concept that school students are "citizens with rights!" It is insidious.
Problem #4, of course, is the culture, which DOES NOT VALUE academic excellence. Some parents value academic excellence, and often they are able to manage their children's education in a way that elicits a "good education" from a system that manifestly is not designed to produce one, but these parents are in the minority overall. How "good" a school district is, is usually determined almost exclusively by the percentage of such parents who sire the students. Interscholastic sports are part of the problem. They keep some of the kids out of juvenile court, which is a good thing I suppose, but overall they are a massive distraction from the theoretical mission of the schools - educating kids.
Money - spending per pupil - has almost nothing to do with it. If a school district has too little money to provide adequate buildings, books, libraries, cafeterias, and so on, then that is a problem, but the examples are too numerous to mention of schools that are funded up the wazoo (D.C., Philadelphia, Chicago, Baltimore, etc.), and yet get "outcomes" that are positively dreadful. In those cases, it is the families and households that are the cause of the problem, and more money dumped in the schools is just a waste, demonstrating nothing more than politicians' having no idea what to do so spending OPM in the hope that voters won't notice that the money is wasted.