Fundamentally, a few things are wrong with math education.

First, you can advance grades without a full understanding of what you were taught. I'm not saying students need 100% comprehension, but letting someone go up in math with only ~50-60% comprehension is a terrible idea. Math builds, and like Jenga, you can't build without a firm foundation.

Math is taught as a set of rote "exercises" with loosely- (and vaguely-) connected theorems. Students are never really given an explanation of why something is useful or why they should even care. You're just expected to memorize it, recite it for the test, and forget it until the final rolls around. This is the mindset school has got us in: so many students don't realize the building nature of math before it is far too late.

Perhaps the most damning thing about math education is its focus on the what, not the why. For example, the quadratic formula: it is introduced and students are told that if you have an equation "of the form" ax^2+bx+c=0, you can "find x" by plugging in the numbers. Never are you given an explanation of where the quadratic formula comes from, never are you given an explanation of why you would want to solve a quadratic.

In my math classes, I was always trying to figure out the "why" behind something. Why were sine, cosine, and tangent all positive in the first quadrant, while only sine was in the second quadrant? We were never told, and most students never even bothered to question why this was so. In fact, when they were told "all students take calculus" and shown the pattern, they just happily nodded and thought "I'll remember that for the test." But if you understand the real reason behind "ASTC," you don't need a silly phrase to remember it.

And, finally, you have the "exercises." You're given a generic 'class' of problem, told how to solve it, and move on. Really good teachers will make some cursory attempt to explain why you can solve a problem how you can, but if a student already has been pushed up through a few math classes he should not have passed, it is likely to be well over that student's head. That feeling of mathematical incompetency just makes them tune the teacher out. And all the while, since grades are the de facto measure of your "worth" in school, the students are thinking "this explanation is too difficult: it won't be on the test." That's a dangerous mindset to cultivate... but the way the system is designed, it doesn't matter one whit.

The student can memorize some facts, never understand why they are as they are, and then study the generic classes of problems that will be present on the test. Then the student can ace the test, feel good about his or her self, and move on, all without any real comprehension. But that's the way the system is designed: you can't apply a teaching process that would really give a full education of math to everyone. For one thing, we don't have teachers skilled enough in math to do so. (A chicken-and-egg problem.) So we are stuck with these half-baked attempts at a curriculum, with kids gaming the system to get their A (or whatever standard they set for themselves) and nothing more.

It's sad. Math is such a beautiful field, full of mysteries and interesting connections. But thanks to the terrible math education system, the vast majority of high school graduates think math is a worthless field full of arcane formulae jumbled about in a seemingly random way all with no real logical structure.