Because in a courtroom situation, the defense attorney will do anything the judge will allow to win his argument.
An erection seems to be something that even the judge will know about. In their limited viewpoint an erection is associated with a desire, which they have all experienced. So they think they are experts.
Those who have experienced abuse (us), know that an erection does not indicate consent, but only physiologic stimulation. I hope we know this. Some perps use this wrongly to fool their victims.
Those guys in the legal profession have never been abused (I know of an exception). That's why they get to where they are (judges, lawyers). They have never struggled with this idea and also the jury and courtroom are uneducated about this. So the attorneys use this but it is hitting below the belt (pun intended).
We need some expert witnesses who can testify that erection does not mean consent but only physical arousal even in a very negative context.