Dr. Daniele Zaccaria said an infected toenail on Sánchez's right foot had had been bothering the him for nearly a week.
“We tried to manage the issue with medication, but in the last few days he was fighting against this problem and no longer able to push on the pedals,” Zaccaria was quoted in a statement released by the team.
After 17 Grand Tour starts without having abandoned, Sánchez, who retired from the race about 20km into the day's stage, said it was not an easy decision.
"This is a hard day for me to have to abandon the Vuelta a Espana," Sánchez said. "The problem with my toenail made it impossible for me to pedal. Yesterday was a really, really hard day for me. I had a lot of pain in my right leg, and today it was just impossible after 35 minutes of the race."
Sánchez, who started the day 20th overall, is the third BMC rider to leave the race, joining Marcus Burghardt and Tejay van Garderen, who both retired due to injuries from crashes.
Meanwhile, De Marchi made it into a five-rider breakaway, attacked his counterparts in the closing kilometres and soloed across the line in Fuente de Chivo to take his first win since joining the team this season.