Your metaphor isn't quite right, a better one would be "should a distributor of a given product be held responsible for determining if the goods they're given are stolen?" To that I would say:
1. A distributor would only use vetted manufacturers, or at least not buy from one again when the products purchased turn out to be stolen
2. When the products are digital, it's much easier to check if they are stolen than physical ones.
3. If it's been determined that a product is stolen, the distributor (generally) isn't held responsible but also isn't allowed to continue selling from the same stock.
Also, I would argue that while it's impossible to detect everything (which is what I said initially too) there should be some legal requirement that the given distributor should show a reasonable attempt to enforce copyright law. The Content ID system, discounting all the ways its abused by a few big companies, is an excellent system for detecting copyright material, and would definitely show that YouTube is at least trying to prevent the spread of material that isn't legal. At the same time, it's clear by this post at least that Udemy is not only NOT vetting their content whatsoever but, similar to Facebook, makes the process to report said content intentionally difficult which I'm sure is not at all related to the fact that as long as said content is live, they're making money.
In short, there's a difference between being a store owner who mistakenly bought stolen products one time, or being a distributor who makes regular business off of stolen product. One shouldn't be held to the fire, one really should.