There's definitely some truth to that. There are situations where someone might restrain themselves because of the consequences of getting caught. I suppose the question is whether the consequence needs to be punishment as opposed to correction or isolation. In the case of a narcissist like Sarkozy, the reputaional tarnish of being publicly labeled as guilty would be an emotional blow.
It's worth considering then that the next person who has the option to do this might behave differently, given Sarkozy has not got away with it.