The closest "gambling" I've ever done was enter into lotto pools at work (which we never won) - mostly for fun. I've never gone to casinos and played any games there.
The advice most everyone is listing here about setting a limit is one of the best pieces of advice. The rush you feel during the games can become addictive (as it sounds you found out), and if you are on a losing streak, if you don't have a pre-set cutoff and stick to it, you can lose a lot fast.
Probably if you approach gambling with the mindset that it's strictly entertainment (and a little bit of a competition), then you might be able to handle the losses better, but you plan ahead that it's okay to lose whatever you plan to bet. If you win, great. If you lose, then you had fun playing the game...like playing those carnival games - you place $5 to play the ring toss game and if you miss, you're out $5, but you had fun trying.