If the hostel has chosen to make a given room female-only, they are stuck with it. If the female dorm currently has no bookings, just call it a mixed dorm for that night.
YHA hostels have traditionally been very strictly male/female separate, and they would have a notice on the door during closed hours: Beds available tonight for females. I thought the main reason why independent hostels had mixed dorms was so they could fill any beds without having to face the problem described above.
I have heard of cases on aircraft where someone is invited to move to a different seat eg "so that this person can sit with her friend" or "because this person needs to get out quickly". I would be very uncomfortable if I was asked this, because if I stay put, I will feel I am being selfish, but on the other hand I will have paid a lot for the flight and a good view out the window is very important to me, and I will have taken pains to choose as good a seat as possible.
So DONT move someone to another dorm, unless: a) That person has not yet arrived, AND b) You are 100% certain that they did not ask specifically for the room they are in, such as being with their friend.