Beckham, sidelined for a month by Capello following his announcement that he would join MLS side LA Galaxy at the end of the season, cancelled out Sociedad's early lead with a trademark free kick eight minutes before halftime.
Ruud van Nistelrooy secured the victory with a brave header, three minutes into the second half to give Real their first points in three games.
"Beckham spares the life of his executioner," was Marca's verdict on the midfielder's goal, saying that Capello was in debt to the former England captain after his performance.
"A gift from Beckham to Capello," was El Pais's description of the goal, while most papers agreed that the victory had saved the former Juventus coach from dismissal.
Capello, who said Beckham's professional attitude in training had persuaded him to reverse his decision to exclude him for the rest of the season, was delighted with his performance.
"You have to be happy when players score important goals and David's goal was very important," the Italian told a news conference after the game. "He played a great game and deserves the credit.
"As I said before, the mark of an intelligent person is one who knows how to rectify his mistakes."