My grandpa fought in WWII and sitting on his knee I learned otherwise about harakiri. Not saying he was right (he actually was a tank commander in the European theater), but I require convincing about what was honorable in that case. A bias if you will.
It was part of bushido, the samurai code of honor. In WWII, bushido was appropriated to terrible and dishonorable ends, but the code had existed for hundreds of years before that (it was actually outlawed for a while).
Generally speaking, bushido is often compared to chivalry. Seppuku (the more accurate name, from what I understand) was a part of it. The feudal lord could order seppuku, but often it was a way for a wrong doer to regain honor. Or for a disgraced warrior to regain a legacy.
For instance: seppuku would always require a second, the guy with a katana who slices off the head of the disemboweled person. That was for a failed seppuku, or to end the misery. But the second was expected to slice the head clean off, and if he failed on the first time, it was greatly dishonorable and the second was often expected to seppuku himself.
Here's the wikipedia entry for a prominent Japanese nationalist who did seppuku in 1970. Note that his "
kaishakunin" -- i.e. the second referred to above -- failed in the slice and then did it himself (failing again, so the guy who had to step in the first time had to off his head as well).
en.wikipedia.org
There's a brilliant anti-Samurai film from the 60s called Harikiri. It's a remarkable film. Absolutely worth watching a couple of times.