What is actually driving this is that income (and other hospital measures) is tied to patient satisfaction. Don't want to lose 30k/year because I didn't give the patient what they want.
I'm an inpatient physician (ICU), so I never prescribe chronic opioids, but I am pretty liberal with them in the hospital. And no, I've never received a Panera lunch for the privilege of hearing about OxyContin.
It's an extremely complex and difficult problem. I think doctors are taking too much of the blame. Maybe we should simply ban the use of chronic opioids for non-cancer pain (or other similar etiologies). When I was a resident, I made all my patients sign an agreement that I would not prescribe chronic opioids unless they had metastatic cancer, were otherwise in a hospice facility, or I made a special exception. Don't sign? Then you find another doctor.
I realize that will evoke some strong emotions from some of you, but you don't see the everyday begging from patients for more opioids when they obviously don't need them. Some people with legit use-cases will suffer under such a scheme. And that could drive up the use of heroin.
There's no easy solution to this problem.