Is gambling OK? Don't bet it! There's not an easy or instantly obvious proof text answer to that question.
Gambling has been an entertainment ever since, however I think what is considered illegal is a sin, so maybe if you are gambling and it is not legal, it can be considered as a sin. Gambling is really fun, but I think if it is against the law, it's just like committing a sin.
Why something is considered and claimed illegal? Do you think governments and legislature of your country is such stupid that they dont know what is sin and what isnt? They know better than us. They have rules, these rules were built under umbrella of values and norms, what is good and what is bad for the people. So whatever is illegal that is considered as sin. Go away from them.