It's a feedback loop - smoking was advertised as being cool way back when, which led to movie characters smoking to appear cool, which then reinforces the advertising.
When there was a push to regulate smoking in advertising, it cut the original feedback loop which made film/tv characters not use smoking as a sign of being cool. This led to advertising (if it were allowed) to be less effective at portrayal of coolness via smoking.
It's not a simple one-to-one cause and effect.