Right, that it was not his fault that someone sent him this much amount in his bank account but how can he use all these funds in gambling without investing where this money comes from. I am sure he has common sense and he did not believe that the bank sent him a bonus or extra money
Not he will have to face the consequences of using funds that did not belong to him.
There can be one possibility that he knew that these funds had come to him accidently and sooner or later the bank will ask him to return the amount. So perhaps he decided to gamble with the funds and hope that he could make good money from these funds and then return the original amount to the bank / owner.
However, if this was the idea then i must say that it was extremely risky and he lost all in the end.