Should it be legal for IA to offer this, especially for older and out of print books? Yes, almost certainly. Is it legal? No, not as the law currently stands. You can support Robin Hood, but you shouldn't be shocked when Robin Hood is caught and sent to jail. It was a mistake and a huge legal risk for IA to do this. It could easily have brought down the whole organisation, and all that they've archived to date. I wis…
Are you a lawyer? Can you point to the relevant statutes? I don't ask this flippantly as there exist many forms (private / public / academic) of library which allow for both physical and digital lending of owned assets and are not subject to lawsuits like this. It's not at all obvious that IA's interpretation of the law is in error.
IANAL, but:
https://www.law.cornell.edu/uscode/text/17/107
https://www.law.cornell.edu/uscode/text/17/108
https://www.law.cornell.edu/uscode/text/17/117
What the Internet Archive did (loan many digital copies based on one physical copy) is illegal as the law stands today.