Sociedad took the lead after just six minutes when Alberto de la Bella set up Agirretxe, who finished well to make it 1-0.
The away side continued to pressurise Vallecano and got their reward on 14 minutes when Xabi Preito set up Agirretxe for his second goal on 14 minutes.
Alejandro Dominguez had Vallecano's first real effort on goal on 26 minutes, but his strike was well saved by the goalkeeper.
Sociedad pushed forward again and Antoine Griezmann came close on two occasions but just couldn't find the finish.
Jose Carlos has the first effort of the second half on 49 minutes, but his shot went just wide of the post.
Carlos Vela fired a shot in on goal on 67 minutes, but the goalkeeper was equal to it.
The home side tried to push forward in a bid to get back into the game, but Sociedad's defence continued to stand firm and saw out the game to claim all three points.