Consider...
difference being, one is a legal profession.
I'm willing to bet that this lawyer was the defense attorney appointed by the court...you know...if you cannot afford an attorney one will be appointed to you......maybe it wasn't his choice to take on this case
...this, if you will; A doctor takes an oath to do no harm. They won't always do their best, they will screw up, they are sometimes negligent, but, the goal, the stated goal is to help and to do no harm.
Lawyers have no such oath. Our justice has, as a cornerstone, judgment both by judges and by juries. The law doesn't just sit there and stand on it's own merits as a simple function of black and white and right and wrong. We judge a person who has been convicted of breaking law to determine severity, intent and so forth. When we limit what is admissible to a jury, we are taking judgement out of their hands and putting it in the hands of a defense lawyer who is, in fact, trying to make things better for what they know is a guilty person. I'd rather that lawyer have to stand in front of a jury and argue why it's not relevant they his clients had sex in that situation rather than arbitrarily have that evidence excluded. That, to me, does harm to justice.
Can you imagine if lawyers took an oath to always seek justice, to not do harm?