Executing Gray accomplishes the primary purpose of any punishment - justice.

Christ ordered individuals to forgive, not the State. The State is neutral and - according to Catholic teaching - acts in God's stead.

Jesus said to render to Caesar what is Caesar, and the justice system is Caesar's.