AFAIK, licensing agreements between libraries and digital publishers typically include a right to perpetual access to articles in a journal or digital library they subscribe to. Any papers published while the licensing agreement is in place are to be made available even if the library cancels their subscription. This also includes the right to make backup copies of the digital library.
(Here's such an agreement between ACM and the Norwegian universities: https://www.openscience.no/media/3449/download?inline )
What the library is allowed to do with this backup probably depends on country-specific laws.
However, if I understand the current situation correctly, ACM allows everyone to download CACM articles but not to redistribute them, right?
In theory, they could also explicitly allow anyone to redistribute all of their publications (they reserve the right to do this in the licensing agreement with authors). However, I'd argue that it is not in ACMs interest to do so - and probably not in mine, either. Having a central, trustworthy source has benefits - e.g. when retracting papers. I'm fine with the ACM DL being free to use and having library backups as safety nets if ACM ever goes under.