It is not a matter of controversy in Islam that mingling between men and women is prohibited or not. Rather it is a distinguishing feature of Islamic culture that men and women should remain separate and perform their duties in a most obliging manner. People who have insight know very well that mingling of men with women is the root cause of many evils that can arise afterwards. The family ties, the relations between husband and wife, the children and other matters can all easily be disturbed as a result of mingling of men with women.
It is natural that men and women are attracted to each other. Islam has provided the legal way for both men and women to marry each other and maintain a family by raising their children. Islam has also imposed some rights on each other in respect of husband, wife and children so that all of them should care about the others and hold strong ties which consist of love, faith and affiliation. But this very purpose is disturbed when the mingling between men and women takes place freely, and the most to suffer as a consequence are the women and children, and they feel deserted. Therefore, it is in the interest of women that they should care about the occasions when such thing could arise.
The same prohibition implies that men should also restrain themselves because it is also in their interest to refrain from such mingling which can disturb them mentally and physically later on. We should bear in mind'that we are to abide by the commandments of Islam which holds all that is good for us.
May Allah help us all to keep on the path of faith.