All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
The prohibition for men to wear women's clothes and for women to wear men's clothes has been stated in several ahaadeeth. For instance, Ibn ʻAbbaas said, “The Messenger of Allaah, sallallaahu ʻalayhi wa sallam, cursed the women who imitate men and the men who imitate women.” [Al-Bukhari] Also, it was reported that the Prophet, sallallaahu ʻalayhi wa sallam, cursed the man who dresses like a woman and the woman who dresses like a man. [Abu Daawood, An-Nasaa'i, and Ibn Maajah - Al-Haakim graded it saheeh (sound) according to the conditions of Imaam Muslim]
The prohibition in reference is regarding the clothing that is peculiar for the male or female gender, but the garments that are common to both genders, i.e. worn by both men and women, are not included in the prohibition.
Al-Haytami wrote, “Grave sin no. 107: men imitating women in what is peculiar to women according to custom of clothes, voice, manner of speaking, movements or the like; and vice versa (women imitating men in the same sense)...” [Az-Zawaajir ʻan Iqtiraaf Al-Kabaa'ir]
That said, with regards to the following narration: “Abu Bakr sought permission to enter upon the Messenger of Allaah, sallallaahu ʻalayhi wa sallam, while he was lying on his bed wearing the mirt (bed-sheet) of ʻAa'ishah...” [Muslim], the mirt is a garment that is worn by both men and women. When a man wears a mirt, this does not constitute imitating women in the slightest. ʻAwn Al-Maʻbood Sharh Sunan Abu Dawood reads: “Al-Khattaabi stated that the mirt is a garment worn by both men and women; as a waist sheet (izaar) or as a robe (ridaa')...”
Thus, there is no contradiction between the prohibition in reference and this narration.
Allaah knows best.