To err is human. We can punish erring drivers by law. But we cannot punish a robot. Unless there is law that applies to the owner of the autonomous vehicle companies on erring automatons unleashed by them :-) and they are implementable.
Do you punish a human because of payback or so that it doesn't commit again the same error ?
Of course its revenge. A eye for a eye, a tooth for a tooth. You are not talking with a civilized species here, although the philosophical decoration sometimes can lead one astray.
We humans aren't rational beings. We're rationalizing beings. I would even suggest we've always felt ourselves to be the epitome of enlightened - even whilst committing atrocities.