The interpretation that Wikipedia gives is that O'Brien was intentionally planted there to root out any thought-criminals.
In truth, O'Brien is an agent of the Thought Police, and is completely loyal to the Party and to Ingsoc. He is part of a false flag resistance movement whose goal is to find thought-criminals (citizens who think something that is deemed to be unacceptable by the party), lure them in by pretending to be on their side, then arrest and "cure" them.
However, I think you could argue for an interpretation that O'Brien was a genuine member of the Brotherhood, who happened to have the unfortunate job of torturing those who were caught.
He had to torture Winston and Julia, because that was his job. He would have blown his own cover otherwise.
Is this correct? What evidence is there to support either way?
Here is a webpage that discusses this question: http://www.orwelltoday.com/readerbrotherhood.shtml