'No chance': Scotland's McGinn angry over VAR ruling in loss to Spain
Elsewhere, Turkey, in their first game under Vincenzo Montella, won in Croatia to vault to the top of Group D and Albania tightened their grip on Group E with a comfortable win over the Czech Republic.
Scotland had won all five of their group games and entered Thursday's match in Seville needing one point from three matches to qualify.
Spain pressed in the first half, but Scotland had the ball in the net first when Scott McTominay swerved a second-half free-kick over Unai Simon.
The strike was disallowed after a VAR review for an offence in the goalmouth by Jack Hendry.
Scotland's John McGinn was unhappy.
"Is he going to save it? No chance," said the Aston Villa midfielder. "No goalkeeper in the world is going to save that. However, at one point he's said it's a foul, realises it isn't a foul, so changes it to offside."
Alvaro Morata converted a cross from Jesus Navas to put Spain ahead after 73 minutes and 10 minutes later, Oihan Sancet, who had come for his international debut after 67 minutes, sealed Spain's 25th straight home Euro qualifying victory.
"Our biggest virtue was patience," said Spain midfielder Rodri. "With the minutes going by and the tiredness, space appeared."
In Larnaca, Erling Haaland scored his fifth and sixth goals of the qualifying campaign. Alexander Sorloth and Fredrik Aursnes also struck as Norway crushed Cyprus 4-0.
Spain stayed second in the group, three points behind Scotland and two ahead of Norway with a game in hand on both.
In Montella's first game, Baris Alper Yilmaz caught home goalkeeper Dominik Livakovic out of his area after 30 minutes and chipped home from long range.
Both teams had further chances in Osijek.
Croatia were held out in the closing stages by goalkeeper Ugurcan Cakir and the offside flag as Turkey won 1-0.
"Turkey deserved this win," said Croatia coach Zlatko Dalic. "We were bad. We had many mistakes from the beginning. We couldn't find our game, we deservedly lost."
Turkey moved to the top of Group D, three points ahead of Croatia.
Albania stayed in control in Group E as they beat the Czech Republic 3-0 in Tirana.
The home team survived some early pressure and punished mistakes by a Czech team that played 50 minutes with 10 men.
Jasir Asani gave Albania a ninth-minute lead against the run of play.
Czech striker Mojmir Chytil was sent off in the 40th minute for a second yellow card and Taulant Seferi scored twice in the second half.
Sebastian Szymanski and Adam Buksa scored as Poland won 2-0 in the Faroe Islands to climb to second in the group, four points behind Albania but one ahead of the Czechs and Moldova.