What I want to know is: Did I do a good job by using gambling to save him? Or do I just make him have an interest in gambling as a source of income?
I don't know what the title has to do with your story, but anyway, based on your story, you have achieved both. You saved him and you made him interested in gambling as a source of income because you did not mention that you discouraged him after you gave him money and you won. You should have told him that he should not do it again, putting money intended for his family to gamble.
We should discourage people from using money allocated for food for the table. As the head of the family, your obligation is to secure the family's basic need, which is food.