These students are obviously not studying; in fact, they're going out of their way to do the opposite of studying, so much so that they arrive at the test with meticulously memorized wrong answers. The students are doing the thing you're decrying here, not the instructor.
Studying requires you obtain mastery of all the material that might potentially be on the exam, in all its permutations. That's the entire point of testing: to force that kind of mastery, without imposing exams that take 4 full-time days to administer. So cheating is doubly immoral: it's dishonest, and it imposes costs on honest people.