But journals help support peer review, selecting high quality papers, etc. Their value proposition exists - if it’s worth the premium is up for debate, but still.
If peer review is the value proposition justifying paywalls, then be aware that none of the money goes to the people providing that value.
When you buy an article through a paywall, you are not paying the author of the article and you are not paying the peer reviewers. Why does it still cost so much? Because they can get away with it. Academia is conservative and changes very slowly because all actors want to preserve their prestige and status and any change may upset the current balance of power. People are used to this system, they've learned how to play by its rules (journal reputations, number of publications, citations, metrics like that).