Apologies for getting political, but I come from a family of teachers in two red states (actually three now, thanks Wisconsin, you do love to hate yourself), and we're out of fucks to give.
EDIT: I know we don't like to get political here, but the question was "Why is America bad at education compared to other countries." First of all, it is bad, and it spends more than other countries, somehow. Makes sense when half the country has put their feet down stubbornly into the stand and said "pull yourself up by your bootstraps!" Or some nonsense.
Here's a great analysis of the Republican platform vis a vis education: https://www.politico.com/tipsheets/morning-education/2016/07...
Inevitable disclaimer: obviously not all republicans are opposed to effective, common sense education, and obviously not all democrats support it. But uh... compare the platforms.