That justification they gave for the stop is utter nonsense. I sincerely doubt that the police ran a check to see if your vehicle was registered to a male or female driver. If that were the case they'd have to run a registration check on every car they encounter to see if the driver matched the registration? Sounds like deliberate harassment to me.