Students at school should not gamble it is illegal because they are underage. Students at college and university in poor countries should understand how hard living in poverty is. It does not make them rich the should be thinking about education not gambling.
Not trying to justify actions but not everyone is lucky to have parent that cater for needs. There are parents that are poor and are still able to provide for their kids need but not everyone and that's why you see a lot of university student gambling. When you check the money used in gambling mostly is either their school fees or up keep money for textbooks and assignment. They risk the money to make more so they can have something before they get another stipend.
If the government want to fight this, they first need to banned physical gambling place around school area. You find it difficult to see tertiary institutions that doesn't have a gambling place where student comes and waste their money unless it's far from town. School public wifi also need to banned some casino website, this way they wouldn't be able to access some popular casino online. This might not be the best solution but it will do some control to student gambling addiction.