Salam,
The Qur'an declares the Prophet (s) "the Mercy for all mankind/worlds". That, in itself, says a great deal about the Prophet's character as leader and a reformist. Ka'bs murder does not fit this profile of the Prophet. According to the narration, Ubai bin K'ab was not killed DURING the battle. Rather he was assassinated by deceit. The Qur'an does allow some "retreat" strategy under some warranted circumstances but these strategies are to considered during open conflicts/battles/wars. I suppose cold war surreptitious assassinations are considered illegal even under international law, but regardless, the point is that the Qur'an does not sanction such assassinations. No prophet is shown to resort to assassination in the Qur'an, let alone the one who was to be the Mercy of the world. When I read about this story many years ago, I felt violates as a believer.
There are many other instances of this nature found in the Hadith literature. Taliban and other extremists, in fact, use these instances to commit despicable murders of non-Muslims and Muslims alike. A prophet is not about assassinating enemies but giving them hope, good news and warning. Yes, if the enemy comes barging face to face, then of course the Qur'an allows self-defense.
Irfan