While peer review isn’t perfect - it’s helpful. Arxiv isn’t peer reviewed. Most things in ACM journals and conferences are. That process costs money because it takes people and time to do it well. Journal subscriptions are often not enough to recover those costs.
As for sci-hub? They’re just taking the finished work. It’s like saying software shouldn’t cost much because The Pirate Bay can deliver software for free.