I'm thinking this must be where I got the suggestion to not carry your passport while touring a city and to carry a copy instead.
Keep track of your passport at all times, including on flights and other modes of transportation. There have been reports of passports being stolen on planes en route to Spain. Do not leave bags unattended. Keep them in sight and avoid placing passports, cash, cell phones, or other valuables in the outer pockets of backpacks or purses on tables or floors, grounds in public places. Do not leave bags slung over the backs of chairs, on hotel or store counters, on top of your suitcase or travel bag, or out of your physical control in hotel lobbies, car rental locations, train stations, restaurants, and other public places. Avoid carrying your passport unless needed for travel, especially in tourist areas. Instead, carry a photocopy or photo of your passport’s biographical information page and consider leaving your passport in a secure location, such as a hotel safe. Your passport will be required to check in into any hotel in Spain and may be required for trains or tourist sites.
Under Safety and Security here:
https://travel.state.gov/content/travel/en/international-travel/International-Travel-Country-Information-Pages/Spain.html