WASHINGTON—Bernie Sanders, in a recent Democratic presidential debate, said that he and President Barack Obama are “friends.”

Yet, although they have campaigned for each other several times, the two men have never forged a strong relationship during their decade of service together in Washington, and a meeting Wednesday marked only the second time they have met alone at the White House.

Emerging...