Peter changed his behavior because he was afraid of the Jewish emissaries from Jerusalem.
Watch the Teaching: Why Paul Confronted Peter to His Face — Galatians Chapter 2