It is misguided to ask, or even think, if something like gambling is 'illegal' in China, because China's 'legal system' is unlike anything you've likely experienced.
Something may be deemed 'illegal' or prohibited by the central government in Beijing, but if the provincial government in Yunnan wants to facilitate the gambling industry it will do so, carefully. I have lived and travelled throughout China, and I can tell you gambling takes place all over the country. Using Whatsapp I found NL Hold'em games in Shanghai, Beijing, ChongQing, Xiamen, Hangzhou ... basically everywhere I went. Even smaller cities had games. In one city card rooms were opening and holding tournaments. They got around the gambling aspect by requiring you to buy points, and to play for points. You could only cash out your points by buying gold bars - which of course were perfectly fungible. The room operators would introduce me to a guy, a regular player, who could buy my points for cash. Of course that was a 'private transaction' that protected the room. Months later when the central government made a show of cracking down on gambling, the local government shut these very public rooms as well, but the games continued in private apartments, arranged through word-of-mouth and Whatsapp.
Lots of Chinese poker players play poker on Chinese websites. They also play poker on Pokerstars of course. These websites might be blocked by the censors, but a committed gambler will find a way around that.
Ok i take the above for granted. So since a "commited" gambler must find a workaround to bypass the "blocked by the censors" sites , it definetely means that those sites are not considered legit for the chinese players, by the chinese government. Also if a gambler needs to gamble privately in private rooms and apartments,or he needs to be "introduced to some guy," or he must plan "gambling sessions" through Whatsapp, then im pretty sure that he can not do otherwise , meaning that he can not do it free and open -> meaning he cannot do it publicly -> meaning its not accepted by the governments rules -> so we can call it "regulated and not legal",thus we can call it illegal .