Because religion is largely made up nonsense fairytales that direct people how their rulers want them to act. Now I'm not saying there aren't some religions with legitimacy, and many do teach good/proper values and ethics, but many don't. In fact, many religions have been used as a form of control and destructions in past times, Christianity being one of those.
I find it ridiculous that religion would specify whether gambling is okay or not, so this is just my two.