The different attitudes now are certainly a result of a slow shift on attitudes about drug use. Some of that is a weariness with the failed drug war, some of it is that people are more educated about the effects of drugs, and some of it is the fact that other countries have decriminalized successfully.
But another aspect is that people are responding to it differently because it is ravaging their own communities. It's easy to demonize drug users when they're people from other groups but not as easy when it is your child or neighbor.
That doesn't necessarily reflect racist attitudes but US drug policy has been absolutely shaped by racism in the past. Drug abuse was seen as just another aspect of black pathology and compassion for addicted users wasn't even on the table. Some of that was because there was a sincere belief that incarceration was the answer but enforcement and incarceration were (and are) disproportionately used against black communities.
And let's not forget that part of the reason marijuana was banned in the first place is because it was thought that black jazz musicians used it to seduce white women.
At any rate, I don't think that focusing on the fact that white folks affected by the heroin epidemic want more compassionate solutions is going to help things. Everyone should just be happy that rationality is beginning to prevail in our response to the drug problem.