This question cannot be answered, nobody knows how often this happens. If someone knew the answer it wouldn't be relevant anyway, because it would be ephemeral.
What we are talking about here is a form of corruption or perversion and pretending it's not happening or pretending it's impossible is the worst thing that can be done because that will only make it worse. Those who are corrupts get an advantage from a system that is not well designed for the present times, their behaviour is rewarded and so the system converges to a corrupt state.
Therefore it's important to fight corruption (and changing the system, but I don't want to go too offtopic). So, how can we minimise the risk for this so that it happens less often?
- Preprints: arxiv.org (and similar services) can keep your preprints online, and they have become standard in some areas as physics (AFAIK). If reviewers try to publish papers that they have rejected the evidence is there, in the preprints server.
- Open reviews: some journals have open and public reviews. The reviewer may still give a bad review based on personal interests but in this way that would be more obvious. Transparency is not a solution to corruption, but it helps.
- Editors: if you have a problem with a reviewer you can raise your concerns to the editor. I have seen people doing this several times and they never had positive news on the result, but this is something that you can do in any case.
- Choose wisely your venues: if the editor is not trustworthy (and the reviewers are anonymous) you may prefer to choose a different venue. In a free market (of papers and venues) with perfect information these venues should theoretically disappear after some time, but practice and theory are not the same (in practice).
There are probably more things that you can do, I hope more people will suggest some in the comments (actually I'm making this post a community wiki post, so feel free to edit). But in short, doing nothing about it (as other answers and comments seem to suggest) would be a very bad idea.
"The only thing necessary for the triumph of evil is for good men to do nothing." - Edmund Burke
PD: The reasons why the system is not well designed are long to explain, it has grown larger (there has never been so many people in academia in history), the fields have grown more specific, the world is more globalized, there is a stronger competition, etc.
PD2: I also agree that probably bad reviews are so because of other reasons, but one of them may be a bad reviewer or a reviewer having a bad day (as people seem to suggest), and what I suggest minimises the impact of this as well (e.g. open reviews).
Additionally we should consider how often papers that are "not that good" get a positive review for other hidden interests (friendship, they are on the same project, they promote the same approach/idea, etc.) this causes an unfair advantage and other papers may get rejected more easily.