To ban gambling would be to limit individual liberty (see also: smoking tobacco, drinking alcohol, self-harm, suicide).
To ban advertising of gambling is to limit a liberty too, but the kind that substantially affects others. See also: dumping a bucketful of water on a passer-by, smoking in a crowded subway car, blaring super loud music outside at night time.
That second kind of liberty is and will always be limited in a society, voluntarily most of the time, because people want to be good neighbors, not harm each other.
Another problem here is the addiction. Advertising applesauce is one thing, advertising cocaine is another. For some people, gambling is more like cocaine, hampering their reason and forcing their hand in making choices. The freedom to advertise cocaine (and tobacco, alcohol, etc) inevitably gets limited in a society; if it does not, the society likely unravels.