
David Villa and Fernando Llorente scored the goals for Spain, extending the team's winning streak to 29 games. Spain hasn't lost a match since November 2006 and earned its 19th straight win overall and its third straight victory over England.
Beckham came on as a second-half substitute to equal Bobby Moore's record of 108 appearances by an England outfield player, but the on-loan AC Milan midfielder did little as England's eight-game unbeaten run was snapped.
Substitutions proved significant for both teams, although Beckham's entrance for Stuart Downing to start the second half didn't provide the necessary spark even though England managed two solid chances.
England coach Fabio Capello left regular center back Rio Ferdinand because of illness, so John Terry was partnered with Phil Jagielka over Matthew Upson.
That change proved crucial as Villa collected Xabi Alonso's through ball at the top of the area, moved past Terry and dragged with his left foot as Jagielka tried to tackle. The rookie Everton defender was left on the ground as Villa burst forward to beat David James with a right-footed shot for his 25th goal in his 42 games for Spain.
Llorente, who replaced Fernando Torres in the 64th, met Xavi Hernandez's cross in the 82nd to head past Robert Green - in goal for James - in his second appearance.
Pepe Reina, playing for Spain goalkeeper Iker Casillas, covered up the rebound after saving Shaun Wright-Phillips' curler in the 72nd minute with Peter Crouch closing in.
Reina was caught out by substitute Carlton Cole in the 88th but the rookie striker saw his angled shot cleared by Carlos Marchena.
Spain coach Vicente del Bosque fielded a similar team to the one that won last year's European Championship as Casillas made his 89th appearance to tie Fernando Hierro for third all time behind striker Raul Gonzalez and fellow goalkeeper Andoni Zubizaretta.
It was England's first trip to Spain since November 2004.
Spain next plays Turkey on March 28 while England, which leads Group 6 with 12 points from four games, hosts Ukraine on April 1.