I am happy to be seen by male HCP and I've had several urology operations with a male surgeon.
However I think there is a real power imbalance that most people seem to be ignoring.
Yes, most senior obstetricians are male, and we have little choice if we are high risk but to be treated by one. However that male dominance in a field where the patients are entirely female has definitely led to a historical culture (IMO) of misogyny. Obstetrics has some really dark moments in its past, around lack of patient consent, treating women like meat, performing unnecessarily painful procedures for HCP convenience, and over-medicalisation.
Just as one e.g., I read a paper from The Lancet from the late 70s recently, which described subjecting women without consent to a very painful procedure intended to speed up labour. It divided those who didn't object and those who did into 'docile' or 'hysterical' patients. Even today, medical language around birth can be positively Victorian: my antenatal notes discuss my 'confinement' for example.
Another would be that Australian obstetrician (CBA to google) who fairly recently mapped the anatomy of the clitoris properly--gobsmacking that such a discovery has been so recent.
My point is, there is a long, long history of a powerful male medical establishment which treated women often like farm animals, or at least like second-class citizens. I don't think that legacy has entirely gone away. And I do think that it's a problem that the senior ranks of obstetrics are so dominated by men still. There is no comparable situation, where ranks of men are effectively compelled to submit to senior women doctors in distressing, intimate situations in the same way. It's just disingenuous to suggest there is.
In such a climate, many women will feel uncomfortable being examined by men; a male-dominated gynae ward would be a problem; and women have the right to refuse IEs by men.
All that doesn't mean you can't have male midwives (which are nothing new by the way; been around since about the 1740s at least). But it's not just personal prejudice on the part of women to be uncomfortable around male HCP in intimate situations.