>>37308500other than Ash being shilled to promote the anime and Pikachu, it can be seen as a lesson to kids "Just because you lose, it doesn't mean you have to give up on your dreams" hence Ash continues to try.
Gary gave up, he failed his dream, Ash hasn't.