Shaykh Ibn ʿUthaymīn رحمه الله:
The Messenger of Allāh (صلى الله عليه وسلم) gave us an important and beneficial principle when he said, “Indeed, when Allāh makes something ḥarām, he makes its earning ḥarām”. This principle is general and applies across various forms of transactions, including selling, renting, offering rewards (jaʿālat), sharecropping contracts (musāqāt) and agricultural agreements (muzāraʿah).
Whenever Allāh makes something ḥarām, he makes its earning ḥarām as well. This is the evidence we use to say it is not permissible to rent shops to those who shave beards (i.e., most barbers). This rental agreement is considered ḥarām because they receive payment from prohibited profits and the Messenger of Allāh (صلى الله عليه وسلم) said, “Indeed, when Allāh makes something ḥarām, he makes its earning ḥarām”.
Source: Taʿlīq ʿalá al-Siyāsah al-Sharʿiyyah li Ibn Taymiyyah, pg. 163-164.
Translated by: Munīb al-Ṣumālī