Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
It would be considered undesirable to get a haircut by a female barber because it would definitely involve physical contact with a non-mahram. So one should try to avoid it.
In his response to the question you raised, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
It is to be noted that meeting, co-operating and integrating with men and women is an instinctive and natural matter that cannot be avoided in reality.
However, Islam puts strict rules to control all contacts between men and women and necessitates that non-mahram members of the opposite sex (i.e., those who are marriageable relatives) should not be in privacy with one another and that they must avoid any physical contact, so as not to lead to sexual arousal or temptation.
Yes, it would be considered undesirable to get a haircut by a female barber because it would definitely involve physical contact with a non-mahram. So one should try to avoid it.
Elaborating on this, Sheikh `Abdul-Majeed Subh, a prominent Al-Azhar scholar, states:
In fact, men can have their hair cut by members of the same sex as there are many male barbers available. Therefore, a male Muslim should be keen to seek a male barber to cut his hair.
Having your hair cut by a female barber falls within the category of doubtful matters which a Muslim should avoid according to the hadith of the Prophet (peace and blessings be upon him): “That which is lawful is plain and that which is unlawful is plain and between the two of them are doubtful matters about which not many people know. Thus he who avoids doubtful matters clears himself in regard to his religion and his honor, but he who falls into doubtful matters falls into that which is unlawful, like the shepherd who pastures around a sanctuary, all but grazing therein. Truly every king has a sanctuary, and truly Allah’s sanctuary is His prohibitions. Truly in the body there is a morsel of flesh, which, if it be whole, all the body is whole, and which, if it is diseased, all of it is diseased. Truly, it is the heart.” (Al-Bukhari)
Almighty Allah knows best.