The Social Security Administration does not recognize drug addiction as a qualifying condition for disability.
If you have a valid disability and you also have an unrelated drug addiction you should still be able to get disability; however, it will be much harder to get disability for your valid impairment because of the drug addiction.
You will find that most Administrative Law Judges are negatively influenced by any kind of substance abuse. It makes your case much harder to win. If your disability is not affected by the drugs and would still exist without them, you may still have a chance of winning your claim. However, most ALJs immediately see drug abuse as a red flag and could use that as a factor to deny your case.
If you have a problem with drug addiction, it is best to work on treating the addiction while pursuing your disability claim.