During my studies, there was one professor who openly said that, if he caught you cheating, he will fail you in his class (which, in Polish universities, means going through a lot of bureucracy to not have to repeat the entire year) - as opposed to other professors, who will usually just allow you another attempt at later time. Also, during the written exams, he wasn't staring longlingly at the sky throught the window (like some other professor did - I assume they wanted to help us cheat, so that we can pass their class and be out of their lives), but was watching us like a hawk 100% of the time. In result, AFAIK there was no cheating in his class at all - it just didn't pay off.
Personally, this hypocrisy and game of cat and mouse was one of the main lessons I learned in high school and later in university ("it's ok to cheat as long as you don't get caught", "nobody cares about their work anyway" etc.). It's a shame that the education system is corrupting the morals of young people in such a way, but on the other hand, the grown up world they're about to join is pretty corrupt anyway, so maybe it's actually teaching valuable survival skills.