I don't think what you said in the last sentence is going to be an issue. Each check-in can be handled separately: you check-in to Spain with the Spanish passport, you check-in to the US with the American passport. There will probably be a box in the reservation system to say "I don't need ETIAS/ESTA"