The bottom line is that funny ads attract attention. Chances are, if people are talking about ads, it's because there is a punch line. "Among my friends, I've been keen to share everything from the slapstick comedy of the Papermate Profile, to the wry humor of the Mac versus PC ads, to the gentle whimsy of Coca-Cola's Vending Machine, and the pun from this Berlitz ad," says Nigel Hollis, chief global analyst at Millward Brown, who wrote the column. "Even if you have seen them before, you would probably be happy to watch most of those ads again. That alone is a pretty powerful incentive for advertisers to enlist the power of humor."
He says neuroscience suggests that peoples' attention is instinctively directed to anything that previous experience indicates is potentially good or bad. Loud noises and images of gore attract our attention because we're taught to fear them. But negative associations don't lend themselves well to advertising other than PSA announcements, he writes. "If the intention is to make people feel good about a brand, then enlisting negative emotions to get them to get attention may well backfire even if it is only because the content is out of keeping with the context." He notes that in some cases the response may be so negative that people respond negatively to both the ad and the brand, as in a "dog breath" ad banned in the UK (you can see it and the others he mentions at the link).