In Harry Potter and the Philosopher's Stone, in the end Harry's most desperate and desirable wish was to retrieve the Philosopher's stone (which he does). I know about the enchantment placed by Professor Dumbledore. But my question is why was Harry's desire to retrieve the stone in the first place? He didn't want to use it anyway. Wanting the stone at that time only increased the risk of letting the stone slip into Voldemort's hand. What did I miss here? Kindly help.
First of all, Harry didn't know about the magic that Dumbledore had put on the Mirror of Erised. So, Harry, when he retrieved the stone, did it by accident.
You are asking why Harry went to retrieve the stone. Well, simple, he knew Dumbledore was not at Hogwarts but at the Ministry. He suspected Snape to be the one to steal the stone. He couldn't tell other professors because nobody would trust his allegations against Snape, not without proof. And Harry was only close to Dumbledore to say anything (accusing Snape) to him, but he wasn't around.
So, Harry went into the trap door to take the stone/stop Snape taking the stone. His motivation was its safety. It was an accident that he unknowingly performed the magic that retrieved the stone from the mirror.
To address your first question:
why was Harry's desire to retrieve the stone in the first place?
Harry came there in an attempt to prevent Snape to get the stone, but then realized that Quirrell was the one who was actually trying to get it.
However, the key thing is Snape's/Quirrel's motivation, as Harry rightly guessed it: the return of Voldemort. Given their history (Voldemort murdering Harry's parents and trying to murder him), Harry's intention at that moment is to prevent Voldemort's return.
Since he doesn't know of Dumbledor's spell, he believes that the only way to do that is to get the stone himself before the other guy does. This translates to his greatest desire being "get the stone (to stop Voldemort)".
There was no doubt, at that moment, in Harry's mind that if he fails to retrieve the stone, the other guy will take it. In other words, he doesn't know that this "increased the risk of letting the stone slip into Voldemort's hands". He believes the exact opposite.