Originally Posted by
catocony
The OP would be using the expired US passport to enter the US, so no problem there. Potentially using the UK passport at the airport in Spain is just to get a boarding pass.
I got the logistics of how it can be done long ago, but to
exit the US, isn't the US requirement ordinarily that a US citizen use a US passport to exit the US when on a commercial flight?