There are certainly other causes of addiction, but at the end of the day a lot of rehab programs fail because even if the addict gets clean, they're immediately sent back to the living situation that got them addicted in the first place. This is especially true for the homeless, "congrats you're free of heroin, now go back to your tent under the bridge where you live in constant fear of rape from other drugged-out homeless people and no employer will touch you! You're free!"
As for "poverty and lack of opportunity" not being a new thing, no shit. But we've seen a hollowing out of the middle class over the past few decades. So a lot of newly impoverished people who grew up middle class, or are else seeing their quality of life decline through no fault of their own. That is relatively new on the scale that we're seeing it.
And I say this as someone who's immediate family has had some past issues with fentanyl addiction, so it's anecdotal, but I'm hardly just speaking from my armchair here.