He had no reason to kill him other than revenge. He was upset that he was taking credit for the killings that weighed on his soul in order to portray himself as a reformed peacemaker. He wasn't in a position where he was forced to kill him in self defense, or where killing him would save other lives like in Pale Moonlight. How would you describe it?
Revenge and Retribution are brothers but there's a difference between killing a man because he wronged you personally and killing a man because he got away with war crimes.
Jack Ruby is not someone who killed Oswald for revenge.