When Winston is caught by the government, he is told that there are three stages to his "reintegration": learning, understanding, and acceptance. Winston doesn't betray Julia until the last stage and when he yells for the torturers to, "Do it to Julia! Not me!", he has capitulated and accepted Big Brother. The acceptance of Big Brother is essential to the government because it means that Winston no longer has free will; he is nothing more than a pawn of the government. Winston had thought he was strong and that he loved Julia. The government does not want any of the people to love anyone more than they love Big Brother and the government because that means that the individual might favor the one loved over the government. By betraying Julia, Winston shows that he loves the government, and Big Brother, more than anyone else.
There are two parts to this.
The first would be when he finally decides for the torture to inflicted upon Julia when the rats were released onto him, to force him to hold on to himself first, before forcing that state of individuality to be accepting of the Party's manifesto, making him loyal and devoted to the party only.
The second would be the fact that he would resultingly place his loyalty, love and devotion to the Party, and only for the Party.
Through his many years in the ministry of love, he had been tortured,starved, bashed, threatened and druged... but he never gave up hope on Julia..eg..Julia! Julia, my love!, Julia!... but then he looked in the mirror and saw he had become... he lost hope, and he started to believe O'Brien...Room 101; the main torturous rooms of all, and because he had a fear of rats he just wanted them to go away so he was started yelling eg. Do to it Julia!! no me!! Do it to Julia!.
Furthermore, they released and saw Julia later on, he placed his hands on her waist but just looked at him like she didn't have a brain... but when they sat down on a park bench and the breeze slammed their cloaths together it felt "awkward"and decided to go..but they promised to see eachother again...
So, because that happened near the end was to show you (the viewer/ reader) what they had and what they would do during the time they had together and how dangerous it was...plus everything happened along with them..plus he thoght O'Brien was his "friend" and told him everything.. buthe didn't betray her...he just stopped loving her, and they remained friends...but at the end Winston loved Big Brother.
Winston lives in a brutal society which attempts to control every aspect of peoples' lives. The authorities even attempt to control what people think and feel. He has no freedom. He has no private life. He is not allowed to feel things that the authorities don't want him to feel' He is not supposed to be an individual, he is supossed to only be a 'citizen'.
But Winston wants a personal life. His Love for Julia is 'anti-social', it expresses his idividuality. He wants Julia and she wants him. It's personal. It's a private. It's exclusive. This is an individual need. He does want 'any' woman, he wants one particular woman; Julia.
For Winston, Julia represents hope, happiness, escape, safety, privacy, love, all the things he hasn't got as a citizen of Oceania.
By betraying Julia, he is betraying hope. He has lost his battle against the state, he will never be free in his head again.