If you loose the bet, he teaches you a level of Lockpick, so loosing the 5000 gold is pretty much the same as buying a spell book. Since gold is so plentiful, I'd rather have the skill level.