Star Trek Into Darkness seems to give a nod to Joseph Conrad's Heart of Darkness not only in its title but in the journey through the moral murkiness that lurks in even the best of us. The book is primarily about the twilight of souls unable to see the light of morality, goodness and virtue. The movie highlights the fact that it's not the galactic space around us that is the true final frontier of undiscovered country. It's the moral space within us.
When Kirk’s mentor is killed by Khan, Kirk understandably wants to get revenge. Though the law requires him to arrest Khan and bring him to trial, he’s ready and willing to subvert the system and just kill him. Well aware that his actions may start a war, he speeds toward Klingon territory to exact his revenge. Spock challenges him to do the right thing. Sure, Kirk’s anger is understandable, and his harsh revenge is a rough kind of justice, but at what point would Kirk become the evil he was trying to fight? Do noble ends justify ignoble means, or must both be good?