There is no simple way to compare the cost of addiction against the cost of rehab, because addiction can cause a huge amount of financial loss in various different ways.
The first factor to consider is the cost of the drugs, which may increase exponentially the longer the addiction goes on for. If the addiction affects your ability to work, you may have to factor in loss of earnings which may occur if you lose your employment. Plus, you could incur legal costs if your addiction results in you being prosecuted.
Aside from financial costs, there are many other costs to addiction. You could sacrifice your physical or mental health, your happiness, your relationships with others, and your ability to pursue hobbies or career aspirations. When you consider all of these factors, the cost of addiction rehab is nothing in comparison.