(....)
How do different religions view gambling? What could be the reasons behind it?
Probably it all roots with the effect of it and that is being greedy. When someone is too greedy, he can do crazy things that he can't ever imagine. But you get the point of these religions but no offense, they don't want their members to gamble because they want their money to be spent well. And you see them ask them every time or at all times talking about them being generous and freely donate to organizations they want to. I have no problem with that but sometimes, there's a conflict if it's about money issues.
Make sense, as greed can be very easily adapted to gambling, that's why there are some religions that hate gambling. Their first step is to avoid gambling, which for me has a good advantage as their people will also benefit from it. Especially since gambling involves money
As they say, prevention is better than cure. So, they're all stopping the root of it before it becomes a fruit.

money is the root of evil

it could add up.
This is a known verse in the bible but it is not money that's the root of all evil. You missed one word of it, the word "love". And with that, it is this verse in the bible;
1 Timothy 6:10 KJV
For the love of money is the root of all evil: which while some coveted after, they have erred from the faith, and pierced themselves through with many sorrows.
There are devoted Christians and Muslims that do gamble despite how much their religion prohibits it, you see them applying core discipline to it, and their lives tend to be more pleasing than even those that claim not to gamble because their religion frown at it. Same people that don't gamble still do take alcohol for the stomach sake.
I wouldn't limit it to the only two faith and beliefs. Not just Muslims and Christians that does it secretly. It's very likely that in some other known faith, despite that their teachings is not to gamble to avoid being greedy. There can be other root cause of it when it's outside gambling and yet, the result is the same and they still become greedy. But focusing with gambling, I guess it has become a normal thing when you hear some stories about a faithful or religious guy then have been seen some casino apps on their phone or into their devices.