The central twist of "The Green Mile" is that John Coffey is not only innocent but a divine, miraculous being with the power to heal. He was found with the dead girls because he was trying, and failing, to 'take back' their deaths. The true killer is revealed to be another inmate on the Mile, William "Wild Bill" Wharton. This is discovered when John grabs Paul and transmits a vision to him, showing Wharton committing the crime.
The film's climax is the execution of the innocent John Coffey. Despite knowing the truth, Paul and the guards are powerless to stop it. John accepts his fate, as his empathetic abilities cause him too much pain in a cruel world. Before he is executed, John transfers a part of his life force and energy to Paul. In a moment of karmic justice, John had previously used the sickness he absorbed from the warden's wife to infect the sadistic guard, Percy Wetmore. This energy causes Percy to shoot and kill "Wild Bill" before lapsing into a permanent catatonic state, thus avenging the girls and neutralizing two of the story's villains in one act.
The ending's final reveal comes in the framing story, where the elderly Paul shows his friend Elaine that the mouse, Mr. Jingles, is still alive after more than 60 years. Paul explains that John's touch granted them both unnaturally long life. He views this not as a gift, but as his punishment: to live on and on, watching everyone he has ever loved die, as penance for executing one of God's true miracles. The final shot is of Paul, alone, contemplating how much longer his own 'green mile' will be.