Not so much a mistake as an ethical choice.
In my view, it's both.
So if Spock randomly kills various natives, he is likely to kill one who would otherwise have children and descendants that would increase in number and eventually become the entire population of his species for countless ages to come. Thus randomly killing natives is likely to change the entire population of the species for countless ages to come. Which seems like a big change to me.
A very great man, I think it was Mister Spock, once said that change is the essential process of all existence.
And in any case, since the future hasn't happened yet, it's not a set, fixed thing-- to say nothing of a sacred, inviolable thing whose exact and precious features have already been decided. If the Galileo party had killed a few hyper-aggressive creatures, that tiny tweak to the gene pool might have led to a more peaceful and advanced future population on Taurus II.
Or, if all the giant apes on Taurus II were equally aggressive, then Starfleet's self-defense would not matter, because where one individual in a planetary population gets killed and does not have X-number of descendants, another one probably will have them, to fill the available carrying capacity (basically, the food supply) of that environment.
An Arthur C. Clarke story, "A Meeting with Medusa" (1971) I think, had a scene where the protagonist discovers lifeforms in the clouds of Jupiter. He remembers a television program he once saw with an astronaut and a space lawyer. The space lawyer mentions the laws about contact with alien life, whether intelligent of not. He says that the law of space requires an astronaut who encounters alien life to do everything he possibly can to avoid disturbing or interfering with the alien life, even at the coast of the astronaut's life. The astronaut asks incredulously if that means he has to let an alien creature eat him without fighting back. "That's right." the lawyer says.
I think that's some flawed ethics, because it fails to put any value on us. Why are our lives worth nothing, and the alien worth everything? Does this mean that if sentient aliens visit the Earth, their lives shall have no value? If so, said aliens will be certain to question such extreme ethical posturing.