While there is undoubtedly libidinal pleasure to be found in substance abuse and gambling.
There are volar stage satisfactions involving the omnipotence of wishes and "being lucky," there are auto-erotic stage satisfactions in oceanic oneness with the world, etc. not to mention the jouissance, in terms of turning bad activities that would invite disapproval and anxiety from father-substitutes into something pleasurable.
However, the superego function of limiting the object altruist to living outside of what others have seems more important.
I've mentioned this before about the homeless, or at least one type of the homeless I've encountered in working with substance abuse, but recent work has deepened it.
In contrast to those who drugs and gambling affect them being able to work and belong to society in basic ways (at the anal level), the volar level of relation to time and just basic survival seems to me to be much more relevant.
Even after the substance abuse is curbed the person is unable to make use of assistance to get their lives back. Everything is scattered and they truly have to live day to day (minute to minute is more accurate).
The Belleropon complex in the object altruist can lead to being banned not just from higher classes, society or basic survival but also from experiencing pleasure and even having health in the most primitive forms of the superego.
To bring up the levels that patients seem to function at and to ask them how it feels to say 'I don't deserve to survive' or 'I don't deserve to have security' etc. will lead to them bringing up bad conscience.
You can't do this without history. You need transference and you need a history of being able to see when they are struggling to tell the truth or not wanting to share a thought.