Why does Oogie Boogie have such a major connection to gambling?
This is a matter of character exposition. There's no need for Oogie to be a gambler, but it add flair/style to his character. Making him a cut-and-dry villain wouldn't work in a setting where everyone in Halloween town looks like a villain. He needs to stand out of the crowd in a way that the audience sees him as a narrative villain.
Most character exposition we get from Oogie Boogie is through his song:
Oh, the sound of rollin' dice
To me is music in the air
'Cause I'm a gamblin' Boogie Man
Although I don't play fair
It's much more fun, I must confess
When lives are on the line
Not mine, of course, but yours, old boy
Now that'd be just fine
This encapsulates why Oogie's gambling defines his narrative villainy: he seeks to harm others. He claims that this is a matter of a dice roll, but we see him change the outcome of a dice roll when it is not harmful to Santa.
Compare this to the other Halloween town citizens. While they do things that appear horrible to us, they always have good intentions. Every toy they built was truly intended to be a gift.
Is this a reference to anything in particular?
The Gambler is the defining trope here, but interestingly, Oogie subverts it. As the trope page points out, Oogie's subversion is particularly reminiscent of Joker from Batman.
The trope page specifically lists Oogie:
Writer and producer Tim Burton and director Henry Selick's The Nightmare Before Christmas has Oogie Boogie, who is shown to base his actions off the roll of a die when torturing his captives. He also has a couple of game-based traps in his dungeon: a giant spinning roulette platform, monolithic cards with swinging swords, one-armed bandits with guns, and the base of spinning propeller blades resembles an 8-ball. Like The Joker, another rare example that manages to be outright evil - he even admits to being ready to cheat in his Villain Song.
Gambler trope characters are inherently defined by them sticking to dice rolls as opposed to predetermined morality. However, do note that Oogie Boogie subverts this by changing a dice roll when it rolls in Santa's favor (thus making him a clear villain).
Much like the Joker, Oogie is a character that pretends to be chaotic neutral ("I leave it up to chance") but in reality is chaotic evil ("I inflict cruelty").
However, I doubt this is intended as direct reference to Joker. It seems more in line with adding a touch of flamboyancy to Oogie's character in order to make him stand out from than the "classic villain" style characters that inhabit Halloween town.