In the case of writing & humanities often the problem is that it is a lot more difficult to tell a correct answer from an incorrect answer. It could be as subtle as the students writing not matching with the professor's political bent.
But for STEM it is way more clear. Wrong answers on a math test are wrong. Software projects that don't compile should fail.
Not sure what the problem is. If the whole class is failing either the school is letting in students who don't belong, whoever taught the prerequisite classes failed to teach the students and passed them on with a curve, or the professor just didn't teach well.