He knew that he did not have to abide by the law in order to reach salvation. He never actually rejected it. What he condemned was telling people that they must practice all of Torah in order to get to heaven.
The idea that you have to practice all of torah to get to heaven, when christians refer to that, they mean without any sin, which is impossible. And that is how they present pharaisic judaism, as teaching that one has to keep -all- of it perfectly. So they teach that you go to hell unless you accept J.
nobody actually taught what Paul claimed.. (assuming it was paul that claimed that and not another gospel writer).
But he was rejecting pharaisic judaism by saying that. He was just twisting it in order to help turn people away from it. He wasn't condemning a belief that didn't exist.. His condemnation was his twist on pharaisic judaism, which was what he was condemning.
pharaisic judaism is belief in keeping the law.. condemning what he condemned was meant to condemn pharaisic judaism
note- christian theology is not my area of expertise!