The basic problem is that we need to rank one researcher's merit against everyone else's, and there's no perfect way to do this because nobody can familiarise themselves with every individual's research. Rely on peers' opinions to measure merit and you just reward back-scratching. Rely on objective measures like citation counts and h-index and you incentivise people to focus on these instead of research quality.
The thing is that macro-scale works pretty well. As an overall system, academic science produces new knowledge at an astounding rate, and in terms of dollars in to research produced I'd say it works pretty efficiently. The measures we use are correlated with research quality even if they don't measure it perfectly.
It's only at the detailed scale where it looks badly flawed.
edit: and of course whenever I spend a long time writing a thoughtful comment I get the "you're submitting too fast, please slow down" message. Time to leave this comment to sit for an hour before pressing reply again...