As has previously been explained, to a ninja honour is everything. If a ninja breaks the rules set by the Sensei to the point where the Sensei or one of their officials is forced to shame them, they may try to make amends by performing seppuku.
The shamed must don the ceremonial robes and set the ceremonial sword against their flesh, and with a single stroke cleanse themselves with their blood. I must bear witness to this. -- [Master Yung on the act of seppuku]
By showing they have enough courage and commitment to their redemption that they are willing to take their own life, a ninja may redeem themselves. As their blood flows from them their dishonour washes away with it.
Seppuku is an act with a lot of tradition and ceremony attached to it. It must take place in the secluded garden and the dishonoured must wear ceremonial robes and use a ceremonial sword else the ritual is meaningless. Master Yung must also be present to personally witness the act in order for the ninja to expunge their shame and rejoin the ranks of honourable ninja.
A ninja without honour holds no place within these halls. The only way to expel such shame is through the drawing of blood and life in the time honoured ceremony which I must witness. -- [Master Yung on honour]
As an example to younger ninja, Jounin Sairento took his own life by performing seppuku. I was fortunate enough to be there to witness the act:
Jounin Sairento stands tall, his hands gripping the sword as he brings the blade to bear against his stomach.
For a moment his head hangs, as he silently contemplates his shame and with unflinching resolve he drives the blade home.
As he slowly sinks to his knees, his arms find the strength to complete the ritual and, like the blood flowing freely from his body,
so is his soul cleansed of misdeeds.
Jounin Sairento dies.