Does it have to be a fluke that we have evolved in the way you describe? Our perceptual and conceptual apparatuses have evolved such that our perceptual beliefs largely match what is "really out there," and so why should it be a surprise (or a fluke) that our ethical beliefs match what is really good? The point of this question is merely to point out that the fact that we have evolved to think a certain way is not by itself a good reason to reject that way of thinking.
That said, your concluding question is a challenging one. How can we decide what is really good or ethical? This question can seem particularly vexing if we think that the laws of morality or the "rules of life" must somehow be "out there" in the world, waiting like the laws of physics to be discovered and understood. But philosophers have long questioned whether values must be "external" in this way in order to be genuine or real. Perhaps our judgments about what matters--about what is valuable or moral or rational--are not really attempts to describe the world at all. Perhaps, as Allan Gibbard has argued, they are just expressions of the norms and principles we accept. If so, then there is nothing particularly problematic about saying that beauty, love, knowledge, and life really matter. You might find Gibbard's book Wise Choices, Apt Feelings interesting, especially since one of his projects there is to explain--in part by appealing to various strands of evolutionary theory--how and why intelligent, self-aware, and social creatures such as ourselves would develop the very notion of something mattering.
Christine Korsgaard, a prominent defender of Kant's ethics, is another philosopher who denies that values (and moral values in particular) must be "out there" in the world in order to be genuine. In The Sources of Normativity, Korsgaard argues at length that we do not discover the laws of morality. Rather, we construct these laws by asking and answering practical questions. Crucially, for Korsgaard, the fact that we are authors of the laws of morality does not in any way make these laws less real or authoritative. In fact, she contends, it's hard to understand how laws that are just out there in the world (like the laws of physics) could have the right sort of authority at all.
Of course these are just two of the many different philosophical approaches to the problem you raise.