O you who have believed, do not enter houses other than your own houses until you ascertain welcome and greet their inhabitants. That is best for you; perhaps you will be reminded.
It was narrated from Sahl bin Sa'd As-Saidi that a man looked through a hole in the door of the Prophet, who had with him a kind of comb with which he was scratching his head.
When the Messenger of Allah saw him he said: "If I had known that you were watching me, I would have stabbed you in the eye with this.
This rule of asking permission has been ordained so that one may not look unlawfully (into people's houses).
[Sunan al-Nasaa'i, Sahih al-Bukhaari, and Sahih Muslim]
What a heinous crime it is to look into someone's house without permission. Do you not read that the Messenger of Allaah (sallallaahu alayhi wa sallam) said: "If I had known that you were watching me, I would have stabbed you in the eye with this?"
This is just for looking into a house without the permission of the owner. Imagine how horrible the act of breaking into someone's house must be in front of Allaah.
A mess of a translation
This hadith has been mistranslated at Sunnah.com here. It has been translated correctly at other places on the website. However, in the link mentioned the author [from whom the website took the translation] seems to have made a complete mess.
For starters the chapter heading has been mistranslated
بَابُ الاسْتِئْذَانُ مِنْ أَجْلِ النَّظَرِ
The author translated it as:
Asking permission without looking
That is incorrect. The correct translation is:
Asking permission was a result [i.e. it had been prescribed because of] the sight
Second, the author translated the hadiith as:
إِنَّمَا جُعِلَ الإِذْنُ مِنْ أَجْلِ الْبَصَرِ
"The ear is put in the place of the eye."
The Hadiith has nothing to do with the ear!!! Instead, the correct translation is:
Seeking permission has been prescribed because of the sight [i.e. in order to protect against a person looking into the house at something he was not supposed to].
This highlights why one needs to be careful when reading translated material.