Muslims should have good relations with all people, both males and females. At school, at work, in your neighbourhood, etc., you should be kind and courteous to everyone. However, it is not allowed in Islam to take a non-mahram person or persons of the opposite gender as a very close friend. This kind of friendship often leads to haram.
Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following: It is common knowledge that in Islam, fornication and adultery are grave sins and committing either bears serious consequences in this world and the Hereafter. However, what is not so well known is that while declaring fornication and adultery as haram (forbidden), Islam does not merely forbid the actual acts, but it also declares as forbidden each and every circumstance or way that leads to fornication and adultery. Allah says, (Do not come near fornication, for it is indeed lewdness and an evil life-style.) (Al-Isra’ 17: 32) explaining this, the Prophet said, “The fornication of the eyes is staring, the fornication of the ears is listening, the fornication of the tongue is talking, the fornication of the hands is holding, the fornication of the feet is walking, the fornication of the heart/mind is craving and lusting, and finally, the private parts confirm or negate it.” He also said, “Staring is one of the arrows of Satan.” In another report, he said, “You are allowed to have the first accidental look (which is unintentional), but do not continue to stare.”
The laws of Islam are from Allah, our Creator, who knows our weaknesses as well as our strengths better than we can ever do. Women, by nature, desire to be looked at, adored and cherished, while man is inclined to look at women. Allah, the Almighty therefore, warns us against our own natures, which may lead us astray if we do not exercise caution and take the necessary safeguards. Thus, Allah, the Almighty said, (Say to the believing men to lower their gazes and guard their chastity… And say to the believing women to lower their gazes and guard their chastity and not to display their charms in public.) (An-Nur 24: 30-31)
having friendship with members of the opposite gender may lead to staring, lustful thoughts, flirtatious behaviour and seduction. Although it may not always be the case, there is no way to tell when it could happen and when it would not happen. That is why it is forbidden to mingle and mix freely with members of the opposite sex and to develop friendships with them. It is all part of zina(fornication), which Allah and His Prophet (peace and blessings be upon him) strongly ordered us to abstain from.
allah, the Almighty has given us laws in order to guard us against the evils that are inherent in our own souls. One recent study conducted about male-female interaction in the workplace concluded that one in every three women had been sexually involved with a co-worker or boss. If this is the case in a professional, business-like environment, then the potential for illicit relations in more casual circumstances has much greater potential. Thus, Allah, the Almighty has been most gracious by not only forbidding fornication and adultery, but also by closing all the doors that lead to them.