Even as President Biden and the leaders of Canada and Mexico sought to emphasize their shared commitments, the tricky issue of immigration dominated much of the discussion.