as it is a respectful measure to take.

What did Aisha who was one of the wives of the Prophet Muhammad (saw) say about carrying the bier inside the mosque?
 'Abbad b. 'Abdullah b. Zubair reported on the authority of 'A'isha that when Sa'd b. Abu Waqqas died, the wives of the Apostle of Allah (may peace be upon him) sent message to bring his bier into the mosque so that they should offer prayer for him. They (the participants of the funeral) did accordingly, and it was placed in front of their apartments and they offered prayer for him. It was brought out of the door (known as) Bab al-Jana'iz which was towards the side of Maqa'id, and the news reached them (the wives of the Holy Prophet) that the people bad criticised this (i. e. offering of funeral prayer in the mosque) saying that it was not desirable to take the bier inside the mosque. This was conveyed to 'A'isha. She said:                      How hastily the people criticise that about which they know little. They criticise us for carrying the bier in the mosque. The Messenger of Allah (may peace be upon him) offered not the funeral prayer of Suhail b. Baida' but in the innermost part of the mosque.