In our son's case, he got caught (by me) grading his own test. He gave himself a "pass" on a very minor penmanship issue that any other student would have marked wrong. The grade wasn't affected at all -- it was strictly the principle.
I made him explain to his teacher what he did wrong & why. He also had to take a zero for that test.
The teacher reacts to cheating quite harshly and I think it helped immeasurably for me to react swiftly to resolve this. I made zero effort to explain the reasoning behind his decision (which wasn't really that "reasonable") as I did not want the teacher to sense any attempt on my part to diminish my son's actions.
Perhaps approaching your son's teacher with something like, "I can not believe he did this -- this is totally unacceptable to us. I'm not sure how best to punish him, do you have any suggestions? I don't want him to walk away from this experience thinking that cheating is not a big deal!"
Say/do something that makes it clear to the teacher that you are on his side, not your son's, regarding the cheat.
Teachers these days hear nothing but a litany of excuses that parents make on behalf of their kids... and/or deal with parental denial ("Oh no! My little Johnny would never do such-and-such.") So it must be refreshing for a parent to stand with the teacher in the face of a disciplinary issue.
And lastly, I required my son to write a lengthy note of apology to his teacher... and he was not allowed to use the computer, either.