You don't yearn for opiates until you've had them. I've never had it, and don't desire to. However, if a doctor, who I trust, gave me Vicodin, I might have taken it assuming he was right. I would eventually become addicted and crave it. Even feeling pain that doesn't exist, convinced that my body needs the drugs to survive.
Similarly, we are exposed to religion by our parents who we trust. And over the years are indoctrinated to need religion. We are convinced of phantom transgressions that we need salvation from.
Both needs are created, and not intrinsic to us.