Language:
كتاب العمرة
26  
`Umrah (Minor pilgrimage)
(18)
Chapter: "... So enter houses through their proper doors"
(18)
بَابُ قَوْلِ اللَّهِ تَعَالَى: {وَأْتُوا الْبُيُوتَ مِنْ أَبْوَابِهَا}
Sahih al-Bukhari 1803

Narrated Abu 'Is-haq:

I heard Al-Bara' saying, "The above Verse was revealed regarding us, for the Ansar on returning from Hajj never entered their houses through the proper doors but from behind. One of the Ansar came and entered through the door and he was taunted for it. Therefore, the following was revealed: -- "It is not righteousness That you enter the houses from the back, But the righteous man is He who fears Allah, Obeys His order and keeps away from What He has forbidden So, enter houses through the proper doors." (2.189)

حَدَّثَنَا أَبُو الْوَلِيدِ، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي إِسْحَاقَ، قَالَ سَمِعْتُ الْبَرَاءَ ـ رضى الله عنه ـ يَقُولُ نَزَلَتْ هَذِهِ الآيَةُ فِينَا، كَانَتِ الأَنْصَارُ إِذَا حَجُّوا فَجَاءُوا لَمْ يَدْخُلُوا مِنْ قِبَلِ أَبْوَابِ بُيُوتِهِمْ، وَلَكِنْ مِنْ ظُهُورِهَا، فَجَاءَ رَجُلٌ مِنَ الأَنْصَارِ، فَدَخَلَ مِنْ قِبَلِ بَابِهِ، فَكَأَنَّهُ عُيِّرَ بِذَلِكَ، فَنَزَلَتْ ‏{‏وَلَيْسَ الْبِرُّ بِأَنْ تَأْتُوا الْبُيُوتَ مِنْ ظُهُورِهَا وَلَكِنَّ الْبِرَّ مَنِ اتَّقَى وَأْتُوا الْبُيُوتَ مِنْ أَبْوَابِهَا‏}‏‏.‏
Reference : Sahih al-Bukhari 1803
In-book reference : Book 26, Hadith 28
USC-MSA web (English) reference : Vol. 3, Book 27, Hadith 30
  (deprecated numbering scheme)