Anyone with an internet connection can write a "paper" and publish it, but that doesn't mean it is useful to the scientific community. Peer review allows the community to filter out quack papers, research which is inherently flawed, or research which has been done before.
This leaves the journals filled with novel research meeting a minimum quality standard, allowing other scientists to build upon them. If you can't get your research published it ostensibly isn't worth anything, so a lot of institutions use the number of papers published and the citations they get as a measurement of a researcher's output. There is nothing wrong with this process.
However, the issue is that journals have been captured by rent-seeking publishers who charge exorbitant fees. This is made even worse because some journals have historically been more strict than others, so getting a paper published in a strict one leads to a higher valuation - and of course the publishers charge higher fees for the more prestigious journals.
Changing this entire model is difficult. Publishing in one of those journals is literally how your worth is valued. Breaking this circle can be done, but it won't be easy.