I guess this is because for the most part they adhere to the US Copyright Law as you also indicated (for the most parts, as this thread highlights a case where they may have crossed the lines).
There is so much gray area around copyright law, and people on both sides are abusing wherever they can. I am often surprised at all the stuff that can be found at YouTube for instance, like full music albums, obviously copyrighted.
I guess both for YouTube and Internet Archive the user who upload the stuff are responsible, and the content provider is alleviated of this responsibility. You can then probably send takedown notices (this is not real protection after copyright has been breached, and places all of the burden on copyright owner to find breaches). On the other hand patent trolling is a real thing too. For instance if you are streaming gameplay on YouTube and have in-game music playing, you be sure to be either demonetized or deplatformed in no time.
I support the part where Internet Archive collects public domain information. For the other parts it is interesting to see what alternatives to the problems with copyright law are brought to the table. Which fair use restrictions are… fair? Are there solutions that would solve either too much freedom of someone’s copyrighted work, and at the same time too much restrictions being placed on it?