The natural consequence of "publish or perish". Rather than evaluating the actual quality of faculty members, universities resorted to a simple metric. Inevitably, people optimized for that metric.
Also, there are just far too many graduate programs and graduate students. Masters programs are lucrative for universities. I am familiar with one program where the standards are deliberately lower than the equivalent undergraduate program. Lots of students, lots of tuition, why not? The "research" that goes on is laughable at best, but plenty of papers get published...somewhere. Meanwhile, PhD students make for cheap labor. I know of one professor who ensures his students get their doctorate, as long as they quietly handle his lectures and grading. Again, papers get published, but let's not look to closely at the content.
Peer review was a great concept, when most researchers were dedicated and competent. Unfortunately, in many areas we have passed a critical point where most researchers have advanced by published poor research, and they apply the same standards to any reviewing they do. Add in the lack of incentive to replicate results, and here we are: widespread academic fraud. Fit your data to the desired curve. Write your conclusion and cherry-pick data to support it. As a last resort, p-hack until you get some fascinating, but entirely coincidental result.