It can be profitable in the long term if you know how to play the gambling game, which depends on the game.
If you're gambling you could stop at a certain amount of money that you've won and the next day you'll leave your winnings at home and not play with it. That's how you can stack up your winnings.