Duplicate, but I'm answering anyways.
Killing is wrong.
Gambling is wrong.
But both have exceptions.
King killing men (or wealth) in battle when challenged is not wrong.
King pawning wealth (or men) in gambling when challenged is not wrong.
Moreover, it was supposed to be a game among family, with his own brothers, invited by his own father's elder brother.