Gambling sites give a bitcoin address for every user. Users send btc to these addresses. They can play afterwards.
How do they ensure the security of these servers? The script they wrote could be safe. But a person working in the hosting company can change these bitcoin addresses. Users who are members of the site will send btc to the hosting employee's address.
What kind of security measures are they taking for this?
You are uninformed and confused, employee in hosting company? you think such activities like processing coins between users and casinos happen in the server? they're being generated in safe and secured bitcoin wallets/ clients and every thing is heavily encrypted.
When you see the lock pad in green color in address bar of your browser saying : Secure | https that means the connection is secured and you are the only one in connection with the site and no one else can manipulate anything.
When it says Not Secure then it's not secure. employee of hosting company lol, you watch Mr.Robot lately?
When you are a member of any gambling site, the site is given a bitcoin address for BTC depositing.
The same goes for trade sites. In order to be able to trade on the stock exchanges, you need to deposit the address BTC first.
These addresses are given to you immediately after you join the system.
Where are these bitcoin addresses stored?