Earlier yesterday, Madrid had comfortably seen off Elche 3-0 at the Santiago Bernabeu thanks in part to a spectacular long-range strike from Gareth Bale.
Barcelona had come into the game on a high after beating Manchester City in their much-anticipated Champions League tie on Tuesday, but went behind when Alex Song turned Sergio Canales' cross into his own net.
Lionel Messi restored parity almost instantly with a clinical left-footed finish.
"We didn't feel comfortable and we didn't have possession, which is our strength. That allowed then to create chances," Barca defender Gerard Pique told Spanish TV station Canal Plus.
Also Read
"Now we have a week to rest and reflect on why things did't go well. It is not worrying, we just have to continue onto the next game."
Barca boss Gerardo Martino had made six changes from the side that started in Manchester as Neymar made his first start in a month.
It was Sociedad who struck first, though, as Song bundled the ball into his own net under pressure from Gorka Elustondo.
The lead lasted only three minutes as Messi fired home his seventh goal in his last five games with an unerring finish from the edge of the area.
Sociedad should have been back in front before half-time when Carlos Vela pounced on an error from Gerard Pique, but the Mexican wastefully blasted over the bar with just Victor Valdes to beat.
And the Catalans' defence also seemed to completely lose their composure at the start of the second-half as Sociedad opened them up at will.