Surely this is sexist. I've never heard anyone say the same with a female.

Women can be criminals too, and occasionally a judge decides a female criminals deserve to go to prison.