It seems to depend on who is doing the punishing.
Recently I found out than an ex of mine ( from 30 years ago!) was recently sent to prison and sacked from the police force because he had an 11 year affair with a woman he met when he was sent to her house to investigate a crime.
I don't know the details of course- just what I read in the paper- but I felt the punishment he got was much more severe because he was a police officer.