residencies have decided to outsource part of their hiring decisions to journal peer-review processes. so now for some submissions, editors and reviewers are not actually doing scientific peer review, but rather screening job candidates for hospitals.
peer review is built to assume good faith work by people who are all part of a community of scholarship, it can partially hold up to people within the community gaming metrics. if people are just going to appear, game the system to publish some papers, and then disappear into their real careers, there's no hope of this working.
i don't understand why residencies want med students to publish papers anyway. it's very difficult to do good scientific research, it requires training, time, and almost always apprenticeship. none of this is part of the medical school curriculum, which is why we need special MD-PhD programs for people who want to do both. nobody expects that doing a PhD in biology or epidemiology would give you any clinical know-how, why is it reasonable to expect the reverse?
Residency is a guild (aka, anticompetitive trust) designed to limit the medical workforce and drive up doctor salaries. It needs artificial metrics to ratonalize the increasing salaries as being for "increasing talent".