There are at least two ways to get HIV. Receive anal sex with someone who is already infected, and shared needles which is common with the use of recreational drugs. Charlie Sheen apparently had both a drug problem and a sex problem, he was involved with high risk behaviors.
To blame anal sex is like blaming needles, just because one use is unsafe doesn't preclude all uses. To receive a shot for needed medication is far different from passing around a syringe of heroine. It is far better to say sex is to be exclusive to a husband and wife and needles are exclusive to a single use.
He is most likely a homosexual and received it that way although needles are possible. Point is, there are no confirmed cases of heterosexual sex.