Lots of places have such rules, either officially or unofficially.
In Korea, by law you have to prove you're a foreigner. In the Bahamas it is legal for the locals to bet, but the casinos kick them out. They've had enough experiences of a guy coming in on payday, losing his money, then his wife coming in the next day with a baseball bat to destroy the machine that took the money. Don't want any more.