The intoxicating effects of many drugs can alter people's behaviour to engage in unsafe behaviours. Also, people who are abusing drugs may engage in 'se*xually risky behaviours to obtain drugs or money for drugs. Thus they would get a likely chance of contracting HIV.
Hope that helps!