publishing papers vs. receiving Masters/PhD
What's the point of any qualification? Well, ideally, it's a standard: a quick, easy and reliable way to assess a candidate's ability.

A PhD is, ideally, a standard that indicates a student is capable of independent research that results in a novel contribution to knowledge, at significant depth.

The publishing of papers can also indicate that someone is capable of independent research that results in a novel contribution to knowledge, at significant depth. Though - at least in the sciences - sole-author papers are relatively rare.

Not all papers are of equal standard: the quality can vary hugely. Not all PhDs are of equal standard, but once we exclude degrees-for-cash and other disreputable institutions, there is broadly (but not perfectly reliably) a certain standard required.

And for most people, the work and talent required to do the research to produce several quality papers, is broadly about the same as that required to attain a PhD. So the PhD provides a better route for many, because it will be more portable, and more easily recognised as a qualification of ability. The PhD course also (typically) comes with institutional support to learn the required research skills.

Additionally, some research grants require a PhD or equivalent degree, in order to be eligible to apply.

The academic posts that I've seen typically require a PhD or equivalent research background: but it's harder to make the case through the latter route. Nevertheless, there are many researchers, quite a few professors, and some heads of department without doctorates, at heavyweight institutions. And there's one department head that I know of who doesn't have any degree - and he really is exceptional.