The pope and the president remade the Catholic church and American politics in their outsider images, but their relationship was defined by their remarkable clashes.