If the self-help/productivity literature and media sector is any indication, normal human beings can't actually control themselves all that well.
This approach has a long and tried history in the western culture too, at individual level - from the story of Odysseus having himself tied to the mast of his own ship, to the guy advising US nuclear strategy during Cold War writing a whole book extolling the idea of gaining the upper hand by voluntarily giving up all control over a situation.
If people couldn't actually control themselves to any degree, society as-is wouldn't function at all. We clearly have a high capacity for it, hell even a trained dog can hold itself back from taking a small treat if it knows it'll get a larger one if it waits. But there needs to be a reason for it, if people have nothing to lose I suppose they won't have a reason to hold back from anything.
And that's also not what those cultures do. Whatever you think of their customs - and I'm definitely not trying to defend their ethics here - those people are not stupid, individually or as societies.
BTW. you used an interesting turn of phrase - "I'm just not gonna put myself into a situation". The things that end up discouraged or outright criminalized by governments usually aren't of the kind where you can trivially control them or avoid exposure. With those things, you are going to be put in a situation, whether you like it or not. For any given thing, maybe not you specifically, but enough people will, so it becomes a problem at scale.
And sure in cases where the results are unthinkable, e.g. mass shootings it makes sense to be preventative, e.g. controlling gun sales. But if we're talking about cheating on exams, that really doesn't make any sense. I mean worse case, the person passes knowing nothing and then first day on their job it becomes apparent they don't know jack and get fired. If they can do the job fine despite cheating then clearly the exam was pointless. Hardly justified to take down communications for the entire region.
As I understand it, this is about maturity exams in Algeria. Maturity exams are a kind of big deal, especially if they're using a single or small pool of variants across the entire country - a single leak can invalidate the exam for a particular subject for hundreds of thousands of people, creating a huge logistical cost and country-wide disruption - and emotional burden for the people having to retake the exam that is deciding their future.
Cheating on those exams isn't something you can brush under the rug - it threatens the very core of the national public education system. It's pretty much the educational equivalent to ignoring clear voting fraud during presidential election.
With all that at stake, if they're really having a big problem with cheating (especially via mobile devices and mobile Internet), then cutting off the Internet for the duration of exams seems like... an acceptable solution.