It’s really a cat-and-mouse game. Ad networks have to scan new ad submissions for malware, but it can be really hard because attackers have a really strong economic incentive to keep coming up with new ways of spreading malware.
It’s hard because the best way to combat this is to use an ad-blocker, but as soon as everyone is using one, there goes our favorite ad-supported web sites…