It doesn't matter if the review process isn't perfect - except to the extent that the lack of any review process would overload us with a lot of rubbish papers.The closed review process simply has like minded individuals agreeing with each other.
Publication in a journal, after any kind of peer review, is only the first step in the process. If you compare it to horse racing, you might say the initial peer review is a bit like acceptances, plus vet certification - as a form of 'review' - that a horse is permitted to run in that race on that day. But once the gates are opened, it's up to the quality of the horse and rider whether they put in a creditable performance, get a placing, win some prize money - or run the wrong way from the off and make complete fools of themselves.
Same thing for science publishing. Peer review only gets you into the competition. Thereafter it's up to the scientific community. A rubbish paper is usually ignored entirely. Sometimes a poor quality paper which claims to extend, explain or refute earlier work by others will gather a few citations simply from people citing it only in order to make mincemeat of it.
Good quality papers with robust conclusions will gather citations, the best of the best will do so for a long time. A scientist who regularly produces such papers might garner awards - some of which could have cash attached - a Nobel being the big time here. That's the real peer review. The whole scientific community gets a chance to look at your work, tear it to pieces if they can, give you a pat on the back if they can't.
What most people who focus on peer review overlook is that science is fiercely competitive. Ask anyone who's made the mistake of going to a science conference with a friend. The criticisms of presentations can be vicious and the arguments strident. It's not pretty, it's not comfortable, and if you're at all thin-skinned, you won't survive.