The consensus that I have heard from people both in and out of the US, is that American universities are generally excellent (if pricey), but mandatory state education (ie. school) is a bit dire.
As for why the school system is like that, I think it's not unreasonable to postulate that there is more than just the system itself at play. There are significant social problems at work (just like the UK, much of the time).
On a purely anecdotal note, from what I've seen and read of them (and I went to an American school for a year, albeit not in the US itself), the physical similarity to prisons is slightly disturbing, though not surprising as they're typically contracted out to the same companies. ^^