it's because you boarded in Spain, and they wanted to make sure you had the proper documents.
The OP will (most likely) board from Port Canaveral, so the immigration process will have already be taken care of.
If you had your ESTA's checked it had nothing to do with US immigration. It was your cruise line who decided to check.
But the US Immigration does not require anyone to have the ESTA printout.
What can happen is that the airline people at the airport in the UK ask to see that printout, but they actually only ask if you've done it.