Like I said, I don't think it's an issue with cost but of culture. When it comes to investment in education, America is actually one of the top countries in the world when it comes to spending on education. Teachers in America are one of the highest paid in the world. America is one of the few countries in the world that actually has a dedicated school bus system where it buses children to school for free. It's also one of the few countries in the world that provides textbooks and teaching material for free to schoolchildren (at least that's how it was when I was going to school) and those are high-quality textbooks too that are hardcover with quality binding. And the school buildings in America are some of the best constructed in the world, compared to school buildings in other countries including China. USA didn't really skimp on costs when it comes to education but the problem is its emphasis is on liberal arts, sports and entertainment and just not enough on math & science. Math and science are just not supported or respected. LOL It's not "cool"; it's nerdy; it's ugly and etc. The cool kids play football or basketball or do cheerleading. They do not study math and put on those nerdy goggles to study science. Those are for the nerds that are just weird. It's the public perception and image. America is very image-conscious.
It's slowly changing now as the government is trying to change the mass' perception of math & science, to cultivate people's interest in studying it or at least supporting it starting with children. So it's a good start and hopefully we will cultivate more STEM talents locally instead of relying so heavily on foreign talents.
Spending doesn't always equate to better quality and US education is a good example of this. Not sure where you get the only a few countries provide textbooks for free. It's true in all developed countries I believe and in most developing countries as well. School bus service is a necessity as walking is impossible in many parts of US and suburbia doesn't have reliable public transportation.

