Well, it punished them both. An ad network that can't display it's ads in places it could before is a form of direct punishment. Forcing sites for choosing ad networks that don't vet their ads well is an additional indirect punishment as well, as it may encourage those sites to choose a more discerning ad network.
On one hand it's unfortunate that the site is being punished, on the other hand maybe they deserve some responsibility for not being more selective. I'm not sure.
It punishes the sites using those ad networks directly, the networks themselves are indirectly punished.