In the case of a programmer, the number of lines of code output, or the number of functions written, or the number of bugs detected and fixed, can all be achieved with less "true value output" (whatever that means). The measurement can be gamed.
Teachers in the UK have been accused of "teaching to the test" rather than "teaching for understanding" - but what more can be expected? When exams test for understanding rather than rote skills, only then will understanding be the aim of the teachers looking for the easy way out.
Let me add that I know many dedicated teachers who do the right thing regardless of the threats posed. They encourage and enthuse their students, ranging widely over their subject to get the students engaged and interested. They know that this serves them better, and will, mostly, improve the test scores, even if not as much as "teaching to the test" would. They know they're doing the right thing, but come under enormous pressure to work more obviously towards improving test scores.
I'm not surprised that many of them buckle under the strain and take less honorable courses.
That's part of the tragedy - the destruction of otherwise excellent teachers.