It seems like there is something wrong with the law that punished him in this case, unless, as one paragraph might imply, it was just about the length of the recording.
We ban recording people having sex without their consent because that can be harmful to them. But if a recording is made to get justice for another harm, then the same rationale as self-defence applies (even though this isn't defence against violence): you should be able to take an action which would in other situations be illegal if it is to remedy a sufficiently serious wrong.
The right to privacy isn't absolute, and various things in this case go against it: spouses generally expect much less privacy from each other than strangers, or an individual from the state, in particular. I might be justifiably annoyed if my partner recorded me non-sexually without my consent, but I think I'd have to give up that objection if someone had been stealing from them while they were out and they set up a camera to try and find the culprit... who turned out to be me. That doesn't seem to go away if my misdeed were sexual.