The media had no business asking him a question about sex between two legal consenting adults. It doesn't matter what he said when he was asked -- the question was out of bounds. Once the media determined that it was a legit relationship, then that should be that.
Leadership requires something more than political calculation. Sam might have lost (a doubtful hypothesis), but had he come clean, he could have governed without the shadow of scandal. Being a leader means putting the public first; by lying, Sam has diminished his own effectiveness.