would locking him up be a better deterrent than trying to keep him out of the ladies room?
There is no conflict between the two. We, as a society, could easily have maintained the old way of doing things, ie USE THE RIGHT FUCKING BATHROOM, and then if he raped a girl, no matter where or when, we lock him up.
You are envisioning a conflict where there is none.