Goals from Sergio Ramos and Gareth Bale saw Madrid grab a two-goal lead early on, but Sociedad eventually proved to be too strong as Madrid lost control, with Inigo Martinez, Zurutuza (twice) and Carlos Vela finding the net for the Basque side.
"We have to apologise to the fans, it is a difficult day for us. The whole team is to blame. We're sorry to the fans, this is hard for us to take, it hurts," Pepe was quoted as saying on the official Madrid website.
"We began the game well, but at 2-0 up we let the intensity drop. They came at us and we didn't keep our heads, or sacrifice ourselves enough, to get through it.
"We just can't let a 2-0 lead slip like that. We all have to roll up our sleeves and fight. We knew this was a difficult place to come, we knew they'd keep going until the end, and they got their reward.
"A lot of people will have found it hard to sleep because of us and that's not right. The club's motto is to fight to the very end, and tonight we failed the shirt."
Real Madrid resume La Liga action at home against Atletico Madrid on September 13.