Why doesn't a substance like loperamide promote analgesia?
This is more of a chemical question I think, but the gist of it is that, unlike its predecessors difenoxin (Motofen) and diphenoxylate (Lomotil), it was specifically designed by Dr. Paul Janssen and other researchers at Janssen Pharmaceutica to have limited bioavailability from the gut (it is easily first-pass metabolized through cytochromes), as well as being too lipophilic to be dissolved in water and thus administered intravenously (and thus, junkies hoping to get a "hit" from loperamide through injections will be sorely disappointed), while still retaining its ability as a μ-opioid receptor agonist to the receptors in the myenteric plexus (resulting in the slowing of peristalsis). (Difenoxin/diphenoxylate in fact is administered with small doses of atropine to discourage abuse.)

In addition, efflux mediated by P-glycoprotein in the blood-brain barrier helps retard the entry of loperamide into the CNS. The concomitant administration of a P-gp inhibitor like quinidine (a stereoisomer of quinine used as an antiarrythmic) with loperamide, however, will cause respiratory depression and other CNS effects that are characteristic of μ-opioid receptor agonists.