Heroin as a symbol
Heroin is a bitter symbol. The use of heroin is highly addictive, so much so that the addicts need medical detoxes to stave of the shakes (withdrawal seizures that are often extremely torturous and fatal). So the choice to use heroin is a symbol for hopelessness, because they are accepting momentary pleasure while admitting privately that they have nothing to live for. Heroin is a step above suicide, in the books depiction.
Death as a motif
There are several dead and dying characters in the book. The narrator watches a man overshoot his heroin and die of an overdose. Most people never witness death, but this narrator has seen it more times than he can count. The occurrence of death is a normal part of his life. The motif is a constant reminder of how horrifying the narrator's life has become, and of the hopelessness he faces.
The legal question
Although the entire cast of characters indulges in illegal activity, they do point out several glitches in the legal system. For instance, a person who is convicted of a felony often cannot find stable work, and so the system condemns them to repeat abuse. Then, there is the issue of corrupt workers, like the nurses who sell dope to recovering addicts for their own profit. In other words, everyone in the book cheats, but only the disenfranchised get caught and abused by the system.
Crime as a means
When these characters become addicted to illegal substances, they are often medically addicted, so much so that if they don't get their fix, they will likely withdraw and die. That means that it is technically illegal for them to get what they need, so why not commit crime? Crime ends up being a means for their own survival, quite literally, but once they are open to committing crime, the criminal element becomes a trap all its own. There are many terrifying characters in the book, including people who seem to enjoy the idea of murdering innocent people (in the narrator's speculation).
The opioid crisis
The motif of addiction has an unlikely source in the book. For instance, many of the addicts were successful people who sustained painful injuries and were prescribed opiates as pain-killers. Those patients are often instructed to take those pills for months, and then when they stop taking them, they realize too late that they are addicted. There are several characters in this book that started with prescribed drugs and ended up on heroin in the blink of an eye.