In fact, it took people about one day from publication to start pointing them out with proof - and these people were (supposedly) less qualified than the peer reviewers.
It is true that, with properly faked data, a reviewer cannot be expected to catch it. Nor can p-hacking generally be discovered from an incomplete description.
But quite a bit of faked and even p-hacked data is less-than-competently done in a way that a reviewer can and should be able to catch;
And observational data or meta-study are much easier to verify, since no experiment was done by the researcher either.
How would you solve this problem?
It's a sign that something might well hold up, but it's not definitive. I think people know this about their own field, and then immediately forget it when dealing with another field.
This isn't self-evident. In fact, it's conceivable that peer review could actually lower the quality of published research by delaying paradigm shifting work from seeing the light of day.