There are many reasons why people become addicted to heroin (and drugs like heroin). There are just as many reasons why people find it difficult to come off heroin (and stay off) and some of these include the reasons they started taking it in the first place.
Perhaps even more importantly in their attempt to actually stay off the drug, is the social aspect of heroin addiction. The addict may find this very hard to leave behind. The network of addict friends, and the addict lifestyle itself, can be very hard to leave behind. In fact, the addict usually needs to have a complete break with this scene, often helped by family and non-addict friends, for a successful rehabilitation. Of course, this also creates problems after the addict is cures as, if there is nothing to replace the previous addiction, the person may easily slip back into heroin addiction and the lifestyle that goes with it. If this happens to often, friends and family alike may become less willing to help as they become more and more fed up with the junky's behavior.
Anther reason that has been suggested why many addicts do not stay off heroin for very long is that they use their addiction for emotional purposes, often adopting the role of one who needs help in order to emotionally blackmail girlfriends, family and friends alike, using it to gain more attention. On the other hand, it can be something like an emotional relationship that takes them out of heroin addiction if they are in danger of losing it. Although, often a junky will let emotional relationships fall by the way rather than give up their habit, as the heroin itself disguises emotions, often until it is too late for a relationship to be saved.