There is nothing wrong with a man sleeping in the same room as his sister, each in his or her own bed, so long as nothing can be see of their ‘awrahs. It makes no difference whether they are fasting or not.
In the case of her brother or other mahrams, the woman’s ‘awrah is all of her body except that which is normally visible such as the neck, head, hands, feet and calves. It says in Kashshaaf al-Qinaa’ (5/11): A man may also see the face, neck, hand, foot, head and calf of his mahram. Al-Qaadi said of this report: It is permissible (to see) what normally appears such as the head and hand up to the elbow. End quote.
His ‘awrah with regard to her is the area between the navel and the knee.
It says in Kashshaaf al-Qinaa’ (5/15): In the case of a woman, she may see what is above a man’s navel and what is below his knees, because the Prophet (peace and blessings of Allaah be upon him) said to Faatimah bint Qays: “Observe your ‘iddah in the house of Ibn Umm Maktoom, for he is a blind man and when you may take off your garment he will not see you.” And ‘Aa’ishah said: The Messenger of Allaah (peace and blessings of Allaah be upon him) screened me with his cloak whilst I was watching the Ethiopians playing in the mosque. Agreed upon. When the Prophet (peace and blessings of Allaah be upon him) finished the Eid khutbah, he went over to the women, accompanied by Bilaal, and he reminded them and told them to give charity. If women were forbidden to look at men, then hijab would be obligatory for men as it is obligatory for women, so that they would not look at them. End quote.
But both of them must take precautions when going to sleep, by wearing something that will cover their ‘awrahs and prevent them from becoming uncovered. Because sleeping is a time when the ‘awrah is likely to be uncovered and desire may be provoked, Islam enjoined separating children in their beds, as Abu Dawood (418) narrated from ‘Amr ibn Shu’ayb, from his father, that his grandfather said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Teach your children to pray when they are seven years old and smack them if they do not do it when they are ten, and separate them in their beds.” Al-Daaraqutni and al-Haakim narrated from Sabrah ibn Ma’bad that the Prophet (peace and blessings of Allaah be upon him) said: “When your children reach the age of seven years, separate their beds and when they reach the age of ten, smack them if they do not pray.” This hadeeth was classed as saheeh by al-Albaani in Saheeh al-Jaami’, no. 418.
The scholars explained separating them in their beds as meaning two things:
1 – Separating their beds, which is the apparent meaning of the second hadeeth.
2 – Not letting them sleep naked in one bed, but if they sleep in their clothes without touching one another, that is permissible so long as there is no risk of fitnah.
Zakariya al-Ansaari (may Allaah have mercy on him) said: Separating them in their beds means two things: giving them each a separate bed, or letting them sleep in one bed, but apart from each other and not touching one another. The latter should be sufficient because there is no evidence to suggest that the hadeeth should be interpreted in the first way only. Al-Zarkashi said: it is to be understood according to the apparent meaning, which is correct because of the following hadeeth: “Separate their beds” and it is supported by the meaning which is the fear of something haraam. End quote from Ansa al-Mataalib (3/113)
It says in Kashshaaf al-Qinaa’ (5/18): When the siblings reach the age of ten years, whether they are male or female, or both male and female, their guardian should separate them in their beds and give each one of them a bed of his or her own, because the Prophet (peace and blessings of Allaah be upon him) said: “And separate them in their beds” i.e., as they used to sleep naked, as it says in al-Mustaw’ab and al-Ri’aayah. End quote.
Ibn Muflih (may Allaah have mercy on him) said: A boy who reaches the age of ten should be prevented from sleeping naked with his sister or any other mahram. This was mentioned in al-Mustaw’ab and al-Ri’aayah. This – and Allaah knows best – was narrated from Ahmad and was the view favoured by Abu Bakr. It was also stated and favoured by most of our companions that children must be separated when they are seven years old or more, and that (a child of that age) has an ‘awrah which he must guard. This issue is well known and is mentioned in Kitaab al-Janaa’iz. End quote from al-Adaab al-Shar’iyyah (3/538).
We have mentioned this for a reason, lest anyone think that this hadeeth implies that a brother cannot sleep in the same room as his sister, even though avoiding it is better for one who can manage to do so.
And Allaah knows best.