I recommend buying a used iPhone with eSIM capability off SWAPPA and then get an eSIM for data only, you’ll use your primary U.S. telephone number for calls and messaging, from Airalo or Nomad. Data service in Spain is very affordable and reliable.
This site is run by Ivar at in Santiago de Compostela.
This site participates in the Amazon Affiliate program, designed to provide a means for Ivar to earn fees by linking to Amazon