It is important to note that there is no character named Olly in the books by George R.R. Martin on which the television series Game of Thrones is based. However, in the television series, Olly is a young boy who is introduced in Season 4 as a new member of the Night’s Watch, and later becomes a key player in Jon Snow’s storyline.

Olly’s betrayal of Jon Snow is a significant moment in the series, as it marks a turning point in the relationship between the Night’s Watch and the Wildlings, and sets in motion a chain of events that ultimately leads to Jon’s assassination. There are several factors that contribute to Olly’s decision to betray Jon Snow.
Firstly, Olly’s entire family is killed by the Wildlings during their attack on his village in Season 4. This traumatic experience leaves him with a deep-seated hatred for the Wildlings, and he is unable to reconcile Jon’s decision to ally with them. When Jon proposes to bring the Wildlings south of the Wall to protect them from the army of the dead, Olly sees this as a betrayal of the Night’s Watch and an insult to his family’s memory.
Secondly, Olly is deeply loyal to his commander, Thorne, and sees Jon’s actions as a threat to the stability of the Night’s Watch. Thorne, who is opposed to Jon’s plan to ally with the Wildlings, uses Olly’s grief and anger to turn him against Jon, convincing him that Jon is a traitor to the Night’s Watch and must be stopped.
Finally, Olly is a young and impressionable boy who has been thrust into a world of violence and death. He is struggling to come to terms with the loss of his family and the harsh realities of life on the Wall. Thorne preys on his vulnerability, using him as a pawn in his own bid for power and influence within the Night’s Watch.
All of these factors come together to push Olly towards betraying Jon Snow. In the Season 5 finale, “Mother’s Mercy,” Olly and a group of other Night’s Watchmen lure Jon Snow into a trap, where they stab him repeatedly and leave him for dead. This moment marks the end of Jon Snow’s storyline in the television series (at least temporarily), and sets the stage for the conflict between the Night’s Watch and the Wildlings that plays out in the later seasons.
In conclusion, Olly’s betrayal of Jon Snow is the result of a complex set of factors, including his traumatic experiences at the hands of the Wildlings, his loyalty to Thorne, and his own personal struggles as a young boy living in a violent and dangerous world. While his actions are certainly reprehensible, it is important to understand the context in which they occur, and the various factors that contribute to them. Ultimately, Olly’s betrayal serves as a reminder of the harsh realities of life in Westeros, and the difficult choices that characters must make in order to survive in this brutal world.