It is for freedom that Christ has set us free. Stand firm, then, and do not let yourselves be burdened again by a yoke of slavery. Mark my words! I, Paul, tell you that if you let yourselves be circumcised, Christ will be of no value to you at all. Again I declare to every man who lets himself be circumcised that he is obligated to obey the whole law. You who are trying to be justified by the law have been alienated from Christ; you have fallen away from grace (Mark 5:1-4).
The argument of the whole book of Galatians is that Christians are free from the Law of Moses, of which circumcision is the highlighted example. Therefore, to be circumcised was tantamount to following the Law. Paul condemned this because it failed to acknowledge that the only basis for salvation was faith in Christ Jesus. And Christ's death had completely replaced the obligation of the Mosaic Law with a new way of the Spirit (Romans 7:6).
Paul cited an example, where Titus, a Gentile believer, was not circumcised when Paul and Barnabas bought him to the Christian leaders in Jerusalem:
Then after fourteen years, I went up again to Jerusalem, this time with Barnabas. I took Titus along also. I went in response to a revelation and, meeting privately with those esteemed as leaders, I presented to them the gospel that I preach among the Gentiles. I wanted to be sure I was not running and had not been running my race in vain. Yet not even Titus, who was with me, was compelled to be circumcised, even though he was a Greek. This matter arose because some false believers had infiltrated our ranks to spy onthe freedom we have in Christ Jesus and to make us slaves. We did not give in to them for a moment, so that the truth of the gospel might be preserved for you (Galatians 2:1-5).
The reason Paul gave for not cirucmcising Titus was "so that the truth of the gospel might be preserved for you." In other words, Paul did not want there to be any confusion about the basis of the Gospel. He was even willing to confront Peter to his face about this (Galatians 2:11-16).
But then why did Paul circumcise Timothy, who had a Jewish mother and Gentile father?
Paul wanted to take him along on the journey, so he circumcised him because of the Jews who lived in that area, for they all knew that his father was a Greek. As they traveled from town to town, they delivered the decisions reached by the apostles and elders in Jerusalem for the people to obey. So the churches were strengthened in the faith and grew daily in numbers (Acts 16:3-5).
What is more, he did this immediately after the Jerusalem Council in Acts 15, where the apostles officially recognized that salvation was by grace alone and that Gentiles should neither be circumcised nor told to keep the Law. Furthermore, they were carrying this message to the churches "from town to town."
Why, again, did Paul circumcise Timothy? The reason is suggested in the text: "He [Paul] circumcised him [Timothy] because of the Jews who lived in that area." We are not told whether these Jews were believers or unbelievers. If believers, then Paul may not have wanted to stir the pot before announcing the decision of the apostles and elders concerning this matter. If unbelievers, Paul may have wanted to remove any hindrance to Gospel proclamation among them. As he would write elsewhere,
Though I am free and belong to no one, I have made myself a slave to everyone, to win as many as possible. To the Jews I became like a Jew, to win the Jews. To those under the law I became like one under the law (though I myself am not under the law), so as to win those under the law. To those not having the law I became like one not having the law (though I am not free from God’s law but am under Christ’s law), so as to win those not having the law. To the weak I became weak, to win the weak. I have become all things to all people so that by all possible means I might save some. I do all this for the sake of the gospel, that I may share in its blessings (1 Corinthians 9:19-23).
In other words, Paul circumcised Timothy, so that he could take him along in his missionary journeys among the Jewish people. While he remained adamant that Christians are free from the Law and must not put themselves under the yoke of the Law, he, nevertheless, kept the Jewish Law in order to gain an audience with unbelieving Jews and to keep from too quickly offending uninformed believing Jews.