There are many reason why a person might be facing drug charges. People who are facing charges for selling drugs might have been enticed by seemingly easy money, even if there was the risk of being arrested. People who are charged with drug possession might have a drug addiction. In the case of the addict, there isn't much point in issuing a punishment for the crime unless you treat the underlying problem.
Court-ordered rehabilitation is one way the court can address the underlying problem. This can help the person to overcome the horrors of addiction and be able to avoid getting into more trouble for drug-related offenses.
One issue that you will come across with court-ordered rehab is that the drug addict would have to find a way to pay for the rehab. In some cases, programs might be available that would help with this; however, this isn't always the case.
Some people who are facing drug charges and who don't have a violent criminal history have the option of participating in drug court. This could give them the change they need to live without drugs. In this program, the person would be supervised by the court, which gives them the accountability they need to stick to the program.
Of course, court-ordered rehab will only work if the person wants to get help for the addiction. If you are serious about getting off of drugs and need an extra hand, you can find out if you qualify for one of the programs, such as drug court, that might help encourage you to live a clean and sober life.
Source: Addiction Resource, "Court ordered rehab," accessed March 03, 2017