Random Headcanon: The Klingon Empire’s “honourable warrior” culture isn’t such a weird, dysfunctional caricature just because of bad writing – it’s actually like that from an in-character perspective, too.
Most of the Klingons who appear on-screen are nobility of some description, and what we’re looking as is a warrior caste that’s made an imperfect transition to being a class of bureaucrats and administrators at some point between the Original Series and The Next Generation – sort of like what happened with the samurai in post-Shogunate Japan.
They’ve got a lot of cultural anxiety tied up in that role shift, and they’ve overcompensated by constructing this nostalgic mythos of a Golden Age of Glorious Battle that never actually existed. The vaunted warrior’s code is a recent invention – largely post-dating that transition, in fact – and those who take it most seriously typically hail from clans whose “warriors” haven’t seen real combat in generations.
Basically, imagine a society ruled by self-hating historical cosplay nerds who have the authority to have you killed if you point out how ridiculous they are.
DS9 pretty solidly backs this up.