سُبْحَانَ ٱللَّٰهِ
Holy Qur'an
Al-Qur'an
Kids Qur'an
Lit., "uninhabited houses wherein there are things of use (mata') for you". In the consensus of all the authorities, including the Companions of the Prophet, this relates to buildings or premises of a more or less public nature, like inns, shops, administrative offices, public baths, etc., as well as to ancient ruins.
lit., non-residential buildings.
The rule about dwelling-houses is strict, because privacy is precious, and essential to a refined, decent, and well-ordered life. Such a rule of course does not apply to houses used for other useful purposes, such as an inn or caravanserai, or a shop, or a warehouse. But even here, of course, implied permission from the owner is necessary as a matter of common-sense. The question in this passage is that of refined privacy, not that of rights of ownership.