Even if you do not make your sim number public, still the scammers will send the text messages to the whole series of the phone numbers. This is what happens in my country though the message aren't about gambling but other services. Even there are software that will deliver text message to every number in sequence.
The only way to avoid such message is not to pay attention to them and also do not click on any link because that can be a phishing link or may lead to any malware installation in our cell phones.
This is true, I don't know how they're getting our numbers. There is also a fault of me that I sign up using my personal number and that's why I get these scam text messages but hopefully that they will be stopped since recently, I don't receive them quite often. And for the others that have kept on receiving them, it's best for you guys to just block the number and any number that texts you these phishing links and scam offers.
Scammers obtain potential victims number from various means, some services sell their customers information online, mostly in the dark web, and this information comes at a very dead cheap prices so anyone can afford it, some Scammers obtain thousands to millions of phone numbers thtough this means.
While some others may start a project or contests, or may lileky be an online service which required incoming members or participants to sign up using their personal information like name and phone number. One can sign up to such a project or service and after some time, the project or service closes, the Scammers through this have obtained thousands of personal information with which everyone who signed up have become their potential victim and target.
The best thing to do what getting messages from unknown sources is to delete the message and block the number (just as you have said).