Pope Francis’s visit Thursday marked the first papal visit in 20 years to a country whose Catholic Church is struggling with profound social and political change.