One way to view a bad school or workplace (and many unpleasant things one goes through) is that it is a challenge one must overcome, much like monks or soldiers enduring extreme heat, cold, or hunger, or castaways trying to survive alone on a desert island, or astronauts in deep space. It is an exercise in learning how to overcome adverse circumstances and thrive in an unforgiving and often hostile environment.
I'm not sure why we decided education (or work) should be that way, but that's often the way it is.