Kirk went in under protest. He was fully prepared to turn around and leave Eminiar and Vendikar to their fucked up ways. But Kirk is overridden by Fox. That puts Kirk in the clear.
And Kirk isn't responsible for Eminiar's treaties particular since the Federation was never part of those agreements. So any attack on Kirk, his crew or his ship puts him in the right to defend himself. If the Eminians had simply asked Kirk and his landing party to leave and he had done so then everyone is happy. But Anan 7 orders them taken and to be killed---that's now unwarranted aggression. And so Kirk gives them a lesson: I was willing to be fair, but fuck with me and the Federation and you're toast.
If anyone is really to blame for the ensuing events it's Fox. Maybe another Ambassador would have agreed with Kirk and heeded the Eminians' warning to stay away. But Fox is obviously a pompous ass who has no clue what he's getting himself (and Kirk's crew) into.