I agree with the conclusion you've already posted: the lawyer upped the 5 years to 15 years because of impulsive pride. However, I think it's interesting to look at this in the wider context of the story, which is really all about pride and impulsiveness set against wisdom and patience.
At the start of the story, both the banker and the lawyer are described as young men, foolish, who (presumably under the influence of alcohol) make a tremendous wager on the spur of the moment without realising its consequences.
Among the guests was a young lawyer, a young man of five-and-twenty. [...]
The banker, who was younger and more nervous in those days, was suddenly carried away by excitement; he struck the table with his fist and shouted at the young man:
"It's not true! I'll bet you two million you wouldn't stay in solitary confinement for five years."
"If you mean that in earnest," said the young man, "I'll take the bet, but I would stay not five but fifteen years."
"Fifteen? Done!" cried the banker. "Gentlemen, I stake two million!"
"Agreed! You stake your millions and I stake my freedom!" said the young man.
And this wild, senseless bet was carried out!
Since the story is told from the banker's point of view, his impulsive nervousness and excitement are described more explicitly than the lawyer's, as is his arrogant pride:
"Think better of it, young man, while there is still time. To me two million is a trifle, but you are losing three or four of the best years of your life. I say three or four, because you won't stay longer."
But the parallelism between the two men at this stage is clear. Both are described as "young", both agree almost instantaneously to this bet of ridiculous proportions, and both are stubborn enough to believe they'll win. It makes sense that the lawyer is as much driven by pride as the banker, and this is why he ups the time from five years to fifteen. The banker has had his moment of showing off, by offering the two million pounds; the lawyer wants to prove that he can match the banker's bravado by making an offer of his own, more than just the suggested five years.
It's later on in the story that the two characters begin to contrast with each other. The banker, interacting with other people and the world around him, changes little. His fortunes change, but his personality does not; he remains foolish and impulsive:
Desperate gambling on the Stock Exchange, wild speculation and the excitability which he could not get over even in advancing years, had by degrees led to the decline of his fortune and the proud, fearless, self-confident millionaire had become a banker of middling rank, trembling at every rise and fall in his investments.
Even when he goes to murder the other man, he lacks the gumption to be certain of his course; he uses phrases like "If I had the pluck to carry out my intention". The lawyer, by contrast, has changed massively during his fifteen years of solitary confinement. Not only his appearance - he's now described as yellow and skeletal - but his personality is totally different. The wisdom he's accumulated during those fifteen years has turned him into an eternally world-weary old man, and he allows the banker to win their bet because he's proved beyond a doubt that he is the better man. The banker spends his night in tears and self-contempt; the lawyer knows enough to be satisfied with himself despite his hatred of the world.
The moral of the story, then, is that patient wisdom triumphs over impulsive pride, and study can turn the latter into the former. The two men started out similar to each other in nature, but end up very different from each other due to their different experiences.