Sheikh `Abd al-Rahmân al-Jar`î, professor at King Khâlid University in Abhâ
Generally, gynecology should be undertaken by women. Islamic societies should endeavor to ensure that there is a sufficient number of qualified female doctors to fulfill the gynecological needs of all the women in society.
In your case, if these duties could be assumed by the female doctors, preferably Muslims, male doctors may not undertake this profession due to considerations of Islamic Law relating to male-female interaction and exposure of female body parts to members of the opposite sex.
In case of a dire need for male doctors along with the failure of female doctors to fulfill this vacancy, it becomes lawful for male doctors to undertake such a profession for dire need and necessity only. Attention should be paid that such a doctor should be a good and pious Muslim who has good manners and is worthy of the people’s trust.
Nevertheless, there should be a concerted and persistent public effort to educate a sufficient number of female doctors to fulfill society's needs.
Since the permissibility of men working in this field is contingent on dire necessity, it ends as soon as that necessity no longer exits. It may not be a wise career decision to devote your time, expense, and effort to specializing in a field that you may not be able to engage in over the long run. Whenever there are sufficient female doctors to do the job, it will become unlawful for male doctors to continue to practice.
And Allah knows best.
Source: Islam Today