How many gamblers out there? Around 25%, according to some sources.
How many compulsive gamblers are out there? About 1% if we judge by the statistics in the US.
And the % of those compulsive gamblers that lead to economic costs due to criminal actions and jail would be even smaller...
On the other hand, we know that the gambling industry is very profitable. This means, that in case gambling is legislated - the revenue from the taxes is huge, which benefits the economy. As an example: https://igamingbusiness.com/us-gambling-revenue-reaches-record-equalling-11bn-for-q1/
So, when making assumptions like that, we should look at both sides of the medal. Overall, considering a really small percentage of the actual damage, that can be done by gambling addicts, the revenue from this industry might actually overlap the costs.
You have a very good point on this. The revenue coming from gambling alone should cover those actual damages coming from the situations brought by gambling and they have a lot more left over. This is why gambling is a very lucrative business. Why do you think government-lottery business can cover a lot of charitable activities? It is no secret that gambling addicts bring a lot of problems to the society but you are correct, one needs to check both sides of the coin here.