It's because Gambling is addictive, it's better to have it out in the open. The single best way to make an addictive habit more destructive is to make it illeagal. The US proved it with Prohibition and most of the world is proving it right now with various other drugs.
If it's illeagal, it doesn't stop people gambling, it just places it firmly on the hands of criminals. Instead of employing people at the bookmakers on the high street, or looking after the horses on the race track, it just creates more work for the police, and more people working in the black economy, paying no taxes. Legal gambling is harmless for most people, and slightly the lesser of two evils for the rest.
( Azizzi, before you complain, Black economy is a recognised term for hidden, informal business like this. Black in this case means in the dark. Well in the UK it does anyway....)