It is only partly true that religion does more harm than good in society. The community makes God into the image it wants vengeful or milky sweet or scrupulously just and so on.
There are two freedoms - the false where a man is free to do what he likes the true where he is free to do what he ought.