TLDR: It isn't.
Longer answer: Much medical research is flawed. How much is debatable, but it's a lot. But the flaws do not always (or even usually) make the research "useless" or "utter garbage".
For instance, in much medical research it is impossible to randomly assign people to conditions. E.g. you can't randomly assign people to "overweight" and "not overweight". That does not make the studies of obesity useless.
Medicine isn't physics or chemistry. People are complicated. Disease is (often) very complicated. There is a lot more error (in the statistical sense) in medicine than in physics. But that doesn't mean it is useless. (E.g. a lot of people who smoke don't get cancer, but so?)
Of course, there are ways medical research could be improved. I am a statistical editor at a couple of medical journals, so I do my small part to improve it.
Another issue is an over-reliance on randomized clinical trials, which reduce some kinds of error at the cost of increasing others. For one thing, people act differently when they are part of a trial than they do in real life. And RCTs often look at samples that have no other medical conditions when, in real life, people with one condition often have others. And there are problems with selecting too many White men and not enough women or people of color. And so on. It's by no means perfect. But there's a long way between "perfect" and "garbage".
For evidence, just look at the amazing progress medicine has made, much of it based on research.
Of course the "pressure to publish" doesn't help. But ... that pressure also applies to the people who are writing papers decrying the state of research.