There are many reasons why Japanese secondary schools display a much more uniform high quality than US secondary schools, including, but not limited to:
Top students commonly choose teaching as a career.
Teachers must rotate every three years from school to school with the express purpose of ensuring that all schools, rural or urban, rich or poor, share the teaching talent of the nation.
The tax base for each local school is national, not local.
Every school is required to have certain minimal basic resources ie every school has a fully appointed science lab, a library, an art room, physical education facilities including a gym, and more.
Homeroom teachers visit the home of every student early in the school year.
Every school provides a hot, highly nutritious lunch to every student.
There is a real national curriculum.
Textbooks must be approved by the Ministry of Education, and schools choose only from the approved list.
Practically every secondary student attends supplementary schools (called juku) at private expense.
Students must pass a college entrance exam to go to college. Each year the exam is published in the local newspapers after the exam is given.
The goal of secondary education is to enable students to pass the entrance exam.
I must add that the Japanese system of high schools is really three separate systems with discrete campuses. Western writers writing about the Japanese education system are not talking about a multi-track comprehensive high school such as what we have in the US. Normally Western writers research, visit and write about academic (or college-prep) high schools whether they know it or not. There are also vocational high schools attended mostly by boys with a few girls, and commercial high schools attended mostly by girls with a few boys.
When you read about the Japanese secondary education system, you are almost always reading about the academic high school system. In my experience, writers seem oblivious to the existence of the other types of Japanese high schools. I am not suggesting that the US should wholesale adopt the educational policies of Japan. I am suggesting that it would be a debate worth having. If US society is choosing the education system it has, warts and all, it would be nice if that choice were made with eyes wide open.