1) is it necessary to take loan to gamble when we have no intention to pay back?
2) is it necessary to commit suicide if such mistake has been made?
1) Pretty sure he had intentions to pay back the loan but with the condition that he had won that bet.
2) No. Guy was likely overwhelmed with the emotions hence he took the decision. As futile as it sounds, he should have let some time pass and it would have shown the solution and emotions would have also started affecting him less.
Thing about suicide is, you want to die anyway might as well go on living, worst that can happen will be death only which you are in for anyway.
By the way, this is why I am not fan of taking loans, they put you under pressure situations if things don't work out.