Naruto didn't forgive Obito for his sins, he told Obito to return to Konoha and take the punishment. The punishment can be anything, a life sentence or a Hang till death. Obito chose to revive the alliance in exchange of his own life.
Even in real life, no matter how brutally a person kills someone or is responsible for a mass murder, if he surrenders to the police, they won't kill him on the spot. Depending on the crimes, he will be punished, that is, a life sentence or a hang till death.
No one has a right to kill the criminal right away if he wishes to surrender.
And same thing happened in the manga.