For example, maybe gamling can continue being legal but advertising for it be outlawed or severely restricted? Can gambling have the same sort of warnings as on cigarettes, maybe with children going hungry because the parent gambled away all the money for the month? Another way is that some part of the revenue from gambling could go to programs such as Bolsa Família that you bring up? Or to fight gambling addiction in some way?
That's my pragmatic view of these types of thing: try to find what actually works and hurts society the least. You'll never find any perfect system with no harm anyway.