This excerpt is taken from Sheikh Abu Hamza Abdul Khaliq Siddiqi's book Sahi Fazail-e-Amaal.
Correcting the rows in prayer is part of establishing the prayer, part of completing the prayer, and a cause of love in hearts.
﴿وَأَقِيمُوا الصَّلَاةَ وَآتُوا الزَّكَاةَ وَارْكَعُوا مَعَ الرَّاكِعِينَ﴾
"And establish prayer, give zakah, and bow with those who bow."
Reference: (2-Al-Baqarah:43)
عن أنس رضى الله عنه قال: قال رسول الله صلى الله عليه وسلم : سووا صفوفكم؛ فإن تسوية الصف من تمام الصلاة.
It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace be upon him) said: "Straighten your rows, for straightening the rows is part of the perfection of the prayer."
Reference: Sahih Bukhari, Book of Adhan, Chapter on Establishing the Row from the Entire Prayer, No: 722. Sahih Muslim, Book of Prayer, Chapter on Aligning and Establishing the Rows, No: 433
The words of the hadith in Sahih Bukhari are:
فإن تسوية الصفوف من إقامة الصلاة.
"Straightening the rows is part of establishing the prayer."
عن النعمان بن بشير رضي الله عنهما، يقول: كان رسول الله صلى الله عليه وسلم يسوي صفوفنا، حتى كأنما يسوي بها القداح، حتى رأى أنا قد عقلنا عنه ثم خرج يوما فقام حتى كاد يكبر، فرأى رجلا باديا صدره من الصف، فقال: عباد الله لتسون صفوفكم، أو ليخالفن الله بين وجوهكم.
Sayyiduna Nu'man bin Bashir (may Allah be pleased with both of them) said: The Messenger of Allah (peace be upon him) used to straighten our rows as if he was straightening arrows through them until he understood that we had comprehended his instruction. Then one day he came and stood up, about to say takbir, and he saw a person sticking his chest out of the row, so he said: "Servants of Allah! Either you straighten your rows properly, or Allah will surely cause discord between your faces."
Reference: Sahih Muslim, Book of Prayer, Chapter on Aligning and Establishing the Rows, No: 436.
عن ابن عمر رضي الله عنه ، أن رسول الله صلى الله عليه وسلم قال: أقيموا الصفوف، وحاذوا بين المناكب، وسدوا الخلل: ولينوا بأيدي إخوانكم، ولا تذروا فرجات للشيطان، ومن وصل صفا وصله الله، ومن قطع صفا قطعه الله.
It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with both of them) that the Messenger of Allah (peace be upon him) said: "Straighten the rows, keep the shoulders level, close the gaps between the rows, be gentle in the hands of your brothers, and do not leave space for Satan in between. Whoever joins the row, Allah will join him, and whoever breaks the row, Allah will break him."
Reference: Sunan Abi Dawood, Chapter on Aligning the Rows, No: 666.
Al-Albani (may Allah have mercy on him) declared it authentic.The Companions (may Allah be pleased with them) used to act with great care upon the teachings of the Messenger of Allah (peace be upon him). Upon hearing these hadiths of the Prophet (peace be upon him), the Companions (may Allah be pleased with them) would align their shoulders to shoulders and feet to feet.
Reference: Sahih Bukhari, Book of Adhan, Chapter on Shoulder to Shoulder, No: 725. Sunan Abi Dawood, Chapter on Aligning the Rows, No: 668.
In today's era, Muslims are afflicted with discord and disagreement among themselves. One of the reasons for this is not properly establishing the rows in prayer. Because as mentioned above in the hadith of the Messenger of Allah (peace be upon him), if the rows are not straight, Allah will cause discord in the hearts. One of the reasons for the love and brotherhood among the Companions (may Allah be pleased with them) was the correctness of the rows. Whereas today, we get annoyed even by standing together in prayer. May Allah reform us.
؎ Standing in one row were Mahmood and Ayaz
Neither was there a master nor a servant
The servant and the master, needy and rich became one
When they reached your presence, all became one