If there was any reason Gary Oak was never punished for all the wrongs he did to Ash Ketchum by the time Ash's Journey ended, it's because giving Gary any comeuppance whatsoever will be a grave insult to Shigeru Miyamoto. After all, if Gary Oak dies, the entire Miyamotoverse that Shigeru Miyamoto conceived when he came up with Donkey Kong in 1981 will perish as well. Talk about the grave consequences of justice...
P.S. Satoshi Tajiri stated that if Ash finally wins, it will be over because it's possible becoming a Pokemon Master is the moment right before you die.