He ﷺ wore it because the weather was cold; Tabūk lies close to Syria and is a chilly region, so he had that woollen jubbah on. When he performed wuḍūʾ, washed his face, and tried to draw his forearms through the sleeves, he found them too narrow and thick for his hand to pass, so he slipped his arm out from beneath the garment and washed it ﷺ.
When he then intended to wash his feet, al-Mughīrah ibn Shuʿbah bent down to remove the Prophet’s leather socks (khuffayn), reasoning by analogy: since the Messenger had not wiped over his sleeves—because they were tight—but instead pulled his arm out in order to wash it, al-Mughīrah assumed that the leather socks should likewise be taken off so the feet could be washed. But the Prophet ﷺ said to him, “Leave them on, for I put them on while in a state of purity,” and he wiped over them. His words “I put them on while pure” mean that he had donned them after performing ablution, and so he wiped over them.
This ḥadīth contains several benefits. One is that the Messenger of Allah ﷺ was a human being who experiences what humans experience in natural matters: he feels cold as people feel cold and heat as people feel heat. For that reason, Muʿāwiyah once saw him with the buttons of his shirt undone—Allah knows best, he was feeling hot, so he opened the buttons. Muʿāwiyah (may Allah be pleased with him) thought that this was a sunnah, yet it is not an unconditional sunnah; rather, it is sunnah only when it brings relief to the body, because