All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad,
, is His slave and Messenger.
Many issues that you mentioned are widespread in the medicine studies in the Muslim countries and other countries. The scholars didn't state that Muslims should be prevented from studying medicine because of the possibility of the occurrence of these abominable actions.
However, what is obligatory on the one who studies medicine is avoiding what is forbidden as much as he can. If you want to study medicine in the country that you are residing in, then there is nothing wrong with that. However, it is compulsory on you to avoid what is forbidden, such as prescribing a prohibited medicine, being alone with a non-Mahram woman (one who is not your wife or a close relative) and looking at her with desire or touching her without necessity. As for looking at private parts when it is needed for the purpose of learning or for treating a patient, it is permissible as much as necessary only, and the treatment of a woman by a man is permissible when it is required by necessity.
However, if you know yourself that studying medicine will expose you to fall in what is forbidden and hurt your religion, then it is impermissible to enroll in it without any necessity.
For more benefit, please refer to Fatwa 262342.
Allah knows best.