As we have learned from the antics of the alleged Climate Scientists, peer review is a joke as a quality control mechanism on the Science.
As an exercise in crony Political Correctness it works quite well.
Peer-review is vulnerable to clique-capture, where a group of scientists tend to control the peer review process at the major journal(s) of their field, and ensure that their stuff gets exposure, and the careers of people who disagree with them get cut short. As you note, one major example of this is the "Climate Science" debacle.
Better would be TRUE "peer review", where a paper gets put on a website, and everybody in the academic community gets a shot at rendering their critiques.