At least here in Germany, half of sale proceedings of state-licensed lotteries go into social causes (our open source ecology germany e.v. managed to get several projects funded through this). Also, they are obliged to check each player against a black list of gambling addicts, which unlicensed online gambling venues probably don't give a toss about.