It was a tight contest with both tries scoring two tries, New Zealand's to Regan Ware and Moses Leo, but it was the goal-kicking of the Spaniards that made the difference as they landed both their conversion chances.
New Zealand play Kenya who lost their first game 5-19 to Argentina, and then Argentina in their second game of the day. That should determine if they play a quarterfinal to complete the second day.
New Zealand weren't alone in the upsets as Great Britain beat the series leaders Australia 21-19.
The Black Ferns Sevens started with a 31-7 win over Brazil, in which Risi Pouri-Lane completed a hat-trick of tries and added a conversion, and then beat Britain 19-7 with Michaela Blyde scoring twice and Kelly Brazier once.
They start the second day with their game against Fiji who beat Great Britain 19-10 and Brazil 31-10.