"The end justifies the means"
I am not sure if that's how the phrase is but i hope u understand it.
So what Itachi wanted to accomplish was preventing a war, well he accomplished it, by the wrong means, but what he was seeking was peace, right? but he couldnt "find" or "get" peace.
By political actions the problems with the uchiha could have ended , in my eyes that's the right way/means. The Uchiha didnt have to die, there are always possibilities.
You know that phrase came up after the first and second world wars from the actions of "evil" ppl on the POV of U.S.