Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Not less important, the journal protects authors who point out mistakes in other papers, especially of big names. Not to imply anything, but just in case such authors need protection. You can see this point by yourself.
The status of a journal is better than an online webpage. That is why people usually ask you whether your preprint on arXiv is published or accepted. Even though arXiv and journals serve basically the same purpose of providing you with new knowledge.
Also, having a journal is to prevent another extreme. Someone puts a statement that such and such results are wrong, and you may say: Well, this is just an online claim, I do not believe in it. There are also other benefits of having such a journal, please see my answer above and more detail in the link.
The point of having a journal is to make sure that the error is genuine. So there will be referees to check that the paper which says that another paper is wrong is correct. Otherwise, anyone can write something, saying that a result is wrong, and put it online. How can you judge whether such a claim is correct? Many times, many people thought that some results are wrong, but actually the people who thought the results are wrong are wrong.