Hisham bin Hassan (may Allah have mercy on him) says: I mentioned (this) before Ibn Sirin (may Allah have mercy on him), and he said: Ibn Mas'ud (may Allah be pleased with him) did that because the mosque was narrow.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5173