I was thinking that many countries are reluctant to legalise certain activities such as gambling, prostitution, smoking, ... and, apart from countries that have strong social and religious restrictions (I refer to those as the death-by-boredom countries) others simply consider than the state should not profit or allow activities that are considered diminishing for the workers or that may harm their health and personal relations (it must be difficult to be an addict to gambling or a prostitute and have a normal life).
However, other countries simply set high taxes to these activities, which I think is a false morality, as if by paying these activities can be less questionable. (Note: I personally do not question regulated gambling).
Man, those persons who make decisions around the tasks that you stated, aren't really stupid. No one is stupid for themselves, they even succeed and become the part of the government, so... But there are a lot of reasons why they do this or that!
When you legalize gambling, prostitution and similar activities, it will cause massive protest in olders and the highest part of society aren't young people. So, in order to win elections, they have to say the things that the majority of people want to hear. If you say that you are going to legalise prostitution in an Orthodox countries, sure, you'll lose a lot of votes in an election. If you legalize gambling, elder people come and say that these casinos are killing new generations and are doing all the evil things for the society... bla bla bla...
When prostitution is illegal, that doesn't mean that the government or some related people aren't earning money. We all know that you'll find dozens of prostitutes in every country, in every place. But it's kept like a secret, prostitutes work secretly, these areas function secretly (in secretly, I mean not loudly). Business owners make the easy money + in some countries they pay police some $$ to keep quiet and ignore/protect them.