Remember, just because the money is spent, it doesn't mean it is spent well. I'm sure a lot of the US dollars are fed into sports programs and other spending, and not directly towards efforts that would benefit the most students or workers.
Montana starting teacher salaries are on par almost with Luxembourg teens working the first day of their first job. One of these needs a 4yr degree and the trust to work with developing minds; can you spot which one?
For example, Austria is notorious for producing desastrous results in any metric (standardized tests, teen Analphabeten...) in relation to its spending on education.
The Hungarian numbers are inflated by religious schools, secular schools only would be in the very end, also we're forcing very old and inefficient teaching methods on our teachers, so old people can jizz their pants seeing kids not having free time to play outside (which they also complain about of course), and we also have a massive corruption problem (renovations, etc., cost way more they should because we need to make the prime minister's childhood friends billionaires).