Spain doesn’t tax deferred compensation for work performed while not a resident of Spain. This also applies to other kinds of deferred compensation, like unvested stock awards. (This is actually kind of cool, because the US doesn't tax stock awards until they vest, so if you move here with a bunch of unvested stock awards, and give up your green card, you may end up paying very little in taxes on your stock awards when they vest)
The bigger problem is whether you have to pay US taxes on your IRA distribution. If you are a US citizen or Green Card holder, sorry, you’re going to get taxed on it (if you have excess foreign tax credits, you might be able to avoid any net additional taxes). And no, the Foreign Earning Income Exclusion does not apply, as pensions are not considered “earned income”.
If you are not a US resident for tax purposes, then make sure you cite the US/Spain tax treaty, which gives Spanish residents the right to have their pensions *only* taxed by Spain (ie not).