After the 2016 presidential election, Republican Party officials credited Facebook Inc. with helping Donald Trump win the White House. One senior official singled out a then-28-year-old Facebook employee embedded with the Trump campaign, calling him an “MVP.”

Now that key player is working for the other side—as national debate intensifies over Facebook’s role in politics.

James...