It's all about scientific communication.
Once opon a time ... researchers wanted to share and discuss their findings with each other. At the beginning, they talked and wrote letters, since there was only a small number of researchers in each field.
With a more and more educated society the research communities started growing. Letters were no longer sufficient, because only a small amount of people could read and interact. The solution was to publish the letters, i.e. allow several print copies which could be distributed to several researchers and/or research institutions.
Letters were mainly like writing down an idea and/or conclusions as a starting point, waiting for the input of one or two collegues/recipients, pick their ideas up and answer to them again with a letter.
The communication via published and widely distributed letters was no longer as interactive as letters. The published research/text was no longer a starting point of a discussion, since a discussion only worked by publishing an answer and waiting for the published reply of the initial author. Each publication had to be printed and send per Mail.
This process had three major disadvantages: (1) It was expensive, (2) it was very slow and (3) since there was no longer a specific recipient which was required to answer, some letters were never discussed/questioned.
Journals shifted the discussion with some colleagues to the time before the publication of the letter/article. This is what we call peer-review. It solved the three disadvantages by being less expensive, by allowing a faster interaction between author and reviewers (only letters between author and reviewers) and by ensuring a critical examination of each published research/text and therefore its quality.
Today ... print publications are more and more vanishing and online/digital publications are the majority. Although the current peer-review process has its problems and issues, it still has the goal to ensure the critical examination of the published research/texts. This is what repositories without peer-review like arXiv can't ensure.
There are several approaches to solve this problem, since there are problems with peer-review and publishers. Some researchers and research societies start their own open access journals where researchers publish and review for free, i.e. research coordinates its own communication without the need of publishers. Another approach is to peer-review after the publication. This is also a community approach but might end up with articles without peer-review, since there are no specific recipients/reviewers which are required to answer. This approach reintroduces disadvantege (3) to the communication process.
In general, most researcher would say that articles that are not peer-reviewed are not quality proved which means that a reader always has to check and validate what is written in the article. Since there are problems with peer-review, most researcher would say, that you also have to check and validate what is written in a peer-reviewed article. With this in mind, one could argue that both ways to publish are equivalent.
Looking at the great picture one could describe the current system of scientific communication as ... let's say ... problematic. Publishers are trying to make money. Funders want to save money. Institutions want their researchers to publish a lot, to be cited a lot and to publish in reputable journals, which are most of the times defined by the impact factor that privileges journals that have been around for some time. Researchers want a wide distribution of their work and good jobs which is most of the time depending on their publication list, the impact factors of the journals they published in and the h-index.
Long story short, the whole system is stuck.
Coming back to your question ... Publishing on arXiv is fine, if your research topic is represented at arXiv. It's also fine to publish on any other (maybe institutional) repository without peer-review. Unfortunately, the current system might penalise this due to the concentration on journals, publishers and bibliometrics when it comes to evaluating research/researcher.