In Galatians 2:11-14, Paul rebukes Peter publicly because he was not walking in step with the truth of the gospel. As I see it, there were 5 stages that led to this public rebuke:
1. Peter went to Antioch and ate with the Gentiles. Remember, strict Jews did not eat with Gentiles (unclean) and certainly did not eat what the Gentiles ate (dietary laws). In eating with the Gentiles, Peter was declaring the gospel. He was implying that they were totally accepted into the fellowship by faith alone. The Gentiles did not need to become Jews in order to be saved.
2. Some men came from Jerusalem, claiming to be from James. It is impossible to tell whether these men actually were from James or were just claiming to be from James. Because of Acts 15:24, I tend to think that they were just claiming James' authority. These were obviously Judaizers who believed that Gentiles must believe in Christ and keep the law in order to have full fellowship.
3. In fear, Peter withdraws from eating with Gentiles. We are not exactly sure what Peter was afraid of, but it must have been related to what these men would say about him eating with Gentiles. The word "drew back" is a military term used for armies who would retreat and find a safer position. Peter's actions were dileberate. In withdrawing from eating with the Gentiles, Peter was contradicting the gospel. He was implying that Gentiles had to become Jews in order to be fully accepted by God.
4. Other Jews, including Barnabas, were lead astray by Peter's actions. Our sins do not just affect us, but often lead others to dishonor our Savior.
5. Paul confronted Peter to his face. Public and damaging sins deserve public rebukes.
The text says at least 3 things were out of step with the gospel in Peter's actions:
1. The fear of man.
3. Legalism (which was the essense of what Peter was implying by his actions).
One of the main points from this passage is that the gospel governs not just our beliefs but also our actions. Some beliefs contradict the gospel and some actions contradict the gospel.