Sahih al-Bukhari 723
Sahih al-Bukhari · Book 10: Call to Prayers (Adhaan) · The straightening of the rows is amongst those obligatory and good things which make your As-Salat (the prayer) a correct and perfect one.
Narrated Anas bin Malik:
حَدَّثَنَا أَبُو الْوَلِيدِ ، قَالَ حَدَّثَنَا شُعْبَةُ ، عَنْ قَتَادَةَ ، عَنْ أَنَسٍ ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " سَوُّوا صُفُوفَكُمْ فَإِنَّ تَسْوِيَةَ الصُّفُوفِ مِنْ إِقَامَةِ الصَّلاَةِ " .
The Prophet (ﷺ) said, "Straighten your rows as the straightening of rows is essential for a perfect and correct prayer. "