The essential idea in Chekhov's ironic and thought-provoking story "The Bet" is that the fifteen years the lawyer spent in solitude changed his character so drastically that he came to despise money and all worldly things. He had grown so used to solitude and solitary meditation that he no longer needed human companionship, and thus he no longer needed money. He wanted to prove to himself as well as to others that he was sincere in relinquishing all worldly goods, like some of the Hindu holy men and other mystics of the world.
He had spent fifteen years in study and meditation. He started off thinking this would be an ordeal, but he soon discovered that there were great advantages to solitude, as long as the banker was willing to provide him with good food, comfortable shelter, and books. He was in a situation many of us would envy. He was able to concentrate and focus his attention on understanding the meaning of existence free from distractions for twenty-four hours out of every day. It was fortunate for him that he experienced his enlightenment, because if he hadn't decided to forgo the fortune he had won he would have been murdered by the banker and would have lost his life as well as the money.
Anton Chekhov had to be a very good writer in order to make the bizarre bet believable and then to make it seem plausible that the lawyer would spend fifteen years in solitary and voluntarily relinquish the fortune he had won--or at least the fortune he thought he had won. The banker's character had not improved over the fifteen years. He has begun as a reasonably honest man and had turned into a dishonorable man and a potential murderer.