It can be profitable in the long-term if:
1) You play poker and other card games where you play against others.
2) You are an expert in horse races.
3) You are an expert in some other sports, use crossbetting and find betting sites that dont ban you when they realize you are a winner.
4) If you find errors in physical casino games. Like the roulette not being 100% completely flat and some numbers tending to appear more than others in the long term.