You are right that it is a local ban/restriction as requested by the government of our country. X in general is obligated to follow the local laws means that once the government ask/request them to restrict the access of any accounts/contents on X which suspected of promoting online gambling, X should do it immediatelly.
At least X is less censorship than Facebook and since the ownership change to Elon Musk, I see it is actually a freedom of speech place. It's big different with Facebook where governments can take down any groups, accounts, delete or hide any posts they want. Facebook with Mark administration is more compliant with any command from governments in many nations.
Even ordinary people in my country can also help the government to report any gambling related accounts. Using VPN will solve it obviously because it is only a local restriction
If it is illegal in your nation, if you or any other people try to use VPN to bypass government restrictions, there is risk that you will be caught, arrested and have big legal problems with government. So using VPN to bypass government restrictions must be considered and used very carefully.