Declaring that El Salvador’s fragile environment could not sustain metal mining operations, legislators across the political spectrum approved the ban, which had broad support, particularly from the influential Roman Catholic Church.