Why is the human body so flawed?
it depends on how you see it.
Human body is a process of thousands if not millions of year of natural selection acting on it. they can do marvelous things but still they can also be the ones working against a desired characters.
Natural selection happens on the existing tools which the population of organism have. it does not give you an ultimate fix for the problem population is facing but will give a solution which can make the population survive in those conditions.
there can be large number of incidents which can be given here to counter argue, but for each argument there will be a justification based on various factors one of it can be Natural selection
check these videos out, they agree with your thought but there is a trade off we want.