It is more complicated than that; many of these addicts are people that were legitimately prescribed a painkiller drug, and when the prescription expires (or their coverage is lost) they buy heroin as a cheaper substitute. Lawmakers want to target the initial (again, legitimate) prescribing of some of these painkillers because they too often create a heroin addict out of a totally normal person.
And they are being quite successful.