It became necessary for Paul to resort to open confrontation, first of all because the word of God supports an action such as this in this manner. Proverbs 25:7.
Again, it seems Peter should have known better. Recall that before He departs, Jesus gave the Great Commission... Go and preach to all nations......This should quickly be understood that the Gospel to be preached has nothing to do with jewish culture and tradition. After all Jesus did not preach the same thing.
Also Peter was the one who saw in a vision how to minister the Gospel or the new Way to gentiles. Has he soon forgotten all these?
Another reason is that in dealing with the issues of eternity, there should be no room for compromise.