Earlier quoted context omitted.
Treating chronic pain has less to do with pain relief and more to do with mental health. Sometimes people just want to forget or feel different for a while. Also, opiates suck!
Where'd you get this idea? Any citations? Your comment reads condescending to me: "my pain is all in my head." But it's not, and treating my mental heath is treating the symptoms and not the cause. The best thing for my mental health would be an end to my physical pain.
People offering mental health treatment are not saying the pain is "all in your head"[1]. They're saying you deserve treatment for all your problems, not just a focus on one specific pain problem.
We've known for sometime that treatment for mental illness is more effective if it looks at more than the patient's mental illness - if it looks at all the biological, psychological, and social factors.
This concept is moving into physical health treatment, especially for long term pain.
And it seems that mental health treatment can reduce the amount of pain that people feel.
[1] I'm not sure if you realise just how dismissive this sounds. Mental illness is debilitating and one of the top ten causes of years lost to disability. Those people aren't "making it up", which is the implication many will draw from your "all in my head" comment.