It's not actually a solution to the Fentanyl problem.
Fentanyl ends up in drugs because it's extremely cheap (among other reasons). The price difference between fentanyl-laced illicit narcotics and the actual substance these people are seeking is actually massive, and end-user cost becomes a huge motivator for people dependent on constant daily intake of opioids. Even in a hypothetical world where regulated opioids were available over the counter, you'd still have significant inflows of illicit and potentially contaminated drugs.
Decriminalization and regulation have been floated as magic bullets, yet even when it comes to drugs like Marijuana in states like California and Colorado we have multiple estimates suggesting that the majority of marijuana sales are still illicit rather than via regulated channels ( http://www.cahcc.com/Portals/0/ADE%20Cannabis%20Report%20_8-... ).
> The real question we should be asking is why can't these poor people get access to proper medicine and treatment?
There is no one, singular "real question" we should be asking. This needs to be addressed on every level. Even in a theoretically idealized world there would still be a need for fentanyl test strips. Experimenting with "research chemicals" (aka obscure drugs synthesized in clandestine labs) is an increasingly common hobby even among people with access to common drugs. There isn't really a scenario where we just flip the decriminalization switch and all of these problems go away.