The match was both an occasion to officially launch the two nations launching a joint bid to host the 2030 World Cup and the hosts to test out a new-look defence.
Cristiano Ronaldo had a frustrating night on his first game in Madrid since leaving Real in 2018 and came close to scoring twice and set up a good chance Diogo Jota filed to take advantage of.
Backed up by Joao Felix, Ronaldo was largely neutralised by Barcelona pair Sergio Busquets and Thiago Alcantara in a tight home midfield in front of a remodelled defence.
Alvaro Morata came closest to scoring for Spain missing two clear chances and hitting the bar in stoppage time.
Manchester City defender Aymeric Laporte made his debut after opting for Spain ahead of his native France.
Some 14,743 masked fans were attended at Atletico Madrid's 68,000-seat Wanda Metropolitano stadium.
Spain continue their warm up for the Euros with a match against Lithuania on Tuesday while Portugal next take on Israel on Wednesday in Lisbon.