It's dumb, and people who do this really need help because they themselves wouldn't really recognize that what they're doing is way out of line until it's too late and they have lost quite a significant amount in what they're doing. People need to control their urges and there's really no better way to do it than recognizing early on that something is wrong if they're doing just this.
Desperation sometimes force people to look into gambling as a way to get some money to pay debt, or to gain quick money for other purposes. Apart from that, there really isn't any reason for a person to chase losses. Perhaps if that person really is struggling financially they shouldn't have gambled in the first place but hey, regrets always come last for a reason.
Another thing is perhaps that person really is deep into their gambling addiction that they feel the need to always chase losses even if it cost them a lot more than what they can lose. If your brain is wired to react the same way on something that continuously happens to you, you won't realize that you're having the same response to address the same scenario over and over again, all the while expecting a different outcome in your mind.
There aren't any straightforward measures to combat chasing a loss. You wouldn't really consider preventing it from happening up until you address that it's a problem that needs fixing. One way to prevent doing this is just setting a limited budget for gambling each month, and sticking with that strict budget no matter what happens. Mix with it your money for your needs and you'll have a hard time thinking of gambling more than what you have allotted for yourself because your next meal is on the line. Sure you may always borrow to your friends, but you'll have to really think before doing so because you will pile up your debt in no time.