Why is heroin a more potent drug than morphine, despite having a similar structure?
The answer to this question lies in the pharmacokinetics of these two drugs: the acetyl groups cause Heroin to be 200 times more lipid soluble than Morphine1. Another example of a common drug would be Fentanyl, which is 580 times more lipid soluble than morphine, with a structure very similar to that of Morphine.
Increased lipid solubility allows these drugs to pass more rapidly across the blood-brain barrier into the Central Nervous System, giving them more analgesic potency and a more rapid onset of action than morphine (the peak blood level of heroin when used intravenously is around 5 minutes2, whereas that of fentanyl is 1.7 minutes3).
As for the sociological aspects, the high potency of these drugs acts as a positive feedback loop. The heroin/fentanyl dose is smaller than morphine, which is preferable for drug smugglers, as they have to smuggle less of the drug, reducing their risk. This explains the high potency and usage of heroin as a recreational drug as compared to morphine.
References:

Mahesh Trivedi, Shafee Shaikh, Carl Gwinnut: &quot;Pharmacology of Opioids&quot;, Updates in Anaesthesia, 2007, pp. 118-124. Link.
Oelhaf RC, Azadfard M. Heroin Toxicity. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; Jan 2020. Available from: https://www.ncbi.nlm.nih.gov/books/NBK430736/
Fentanyl Citrate Injection, USP. FDA Label.