O'Brien explains to Winston that he is insane to oppose the Party. The purpose of the torture O'Brien inflicts is to show Winston that power is expressed most fully in forcing others to suffer, but more importantly, to reintegrate Winston into the Party.
O'Brien describes power as the boot stamping the human face and his torture of Winston expresses O'Brien's absolute control over his victim. O'Brien uses that control, however, not only to compel Winston's outward obedience. He tortures Winston to convince him to believe that truth is subjective: it is whatever the Party tells him it is. For example, when Winston avers that two plus two equals five but doesn't really believe it, O'Brien twists the back-breaking pain meter up high. Winston needs to really believe that two plus two equals five, not simply pay lip service to the idea or practice outward conformity while continuing to think otherwise inwardly. Finally, O'Brien tortures Winston using his deepest fear, of being devoured by rats, to force him to betray Julia. Once he has betrayed her, Winston has nothing left to cling to and can fill his inner emptiness with worship of Big Brother. Thus, torture acts to allow the Party to control Winston body, mind and soul.
Although the Ministry of Love uses torture to interrogate prisoners and induce confessions, Winston's actual crimes are far less important than the independent thinking that led to his dissent. In order to stamp out all thoughts and beliefs that contradict the government's rewriting of history and current events, the Ministry of Love uses drugs and various mind control devices that cause Winston pain when he adhers to his beliefs and give relief when he submits to authority. In the end, Winston is conditioned to believe that the truth is a lie and that the government's fiction is the truth, so he no longer has any reason to rebel.