I'd say they are mostly moral.
The president P. Sanchez, has been clearly antagonizing Trump in these and other intl issues (even if only visible in spain, as he is not that relevant internationally, etc)
But anyways, this seems like deepstate fighting vs current US admin and current Spain admin, one can infer "Palantir" is basically a gag order away from giving the US govt anything it wants, so as an antagonist. to its current admin, it seems smart to avoid having them as critical providers.
why choose china? Makes no sense, but probably the only other big bro Spain can rely on if the US isn't it anymore
i’m sure they wouldn’t be nearly as concerned about a US company that manufactured screwdrivers or nike or something similar.