The legality of that is also dubious, especially in the case of CC-NC or similar content. The Grateful Dead, for example, have a very strict non-commercial-use license for their concert recordings which explicitly forbids any sort of advertisement attached to their music. If I put the Dead's music on my (ad-free) site, and someone else injects ads, that someone could well be liable for violating the Dead's copyrights. Which, since many of the Dead's copyrights are held in part by one of the founders of the EFF, could be a risky move.
Of course, most content on the net is provided as-is, so it's not a general problem, but for cases like this, the ISPor CDN might well find themselves in legal hot water. (And it does have some obvious analogy to the case at hand.)