Clean IP history is especially important for "universal donor" sample code intended to be copy/pasted. If there turns out to be an IP violation in library code, with luck it may be possible to excise it from the library -- and hopefully not too many downstream will have forked it. But when code is copy/pasted, the linkage is severed and the damage becomes increasingly difficult to repair.
For those reasons, I'd prefer to see something like a contributor list of public identities for collections of sample code, so that it is transparent who is making the licensing promises.
For example, if a project under the Apache License 2.0 were to accept a contribution of CC-BY-SA code, the complete product could no longer be available under the Apache License (and other licenses with similar terms) -- causing problems for downstream consumers.
That makes it easier for sample code to achieve the ends of maximum code reuse and popularization of the underlying technology.