We had the same problem last month with a 10pm flight. We booked a hotel room for the day cost 90 Euro between 6 of us & we all considered it worth while.
If you are travelling with Royal Caribbean you could perhaps do what we did. Our flight wasn't until the afternoon so we booked a RC shore excursion to Montserrat. They took our luggage on the bus and delivered us all to the airport on the way back. I'm not sure if they offer this on your itinerary but it was well worth it.
You could always try a local hotel in the centre of Barcelona. They would probably charge a small fee but better than carrying your luggage around.
Yes, you can leave your luggage at Barcelona Sants train station. Around €4 per locker.
However, if you have booked the flights with the cruise, then they will take you to the airport and leave you there all day - so you will be there from around 10am. Take a good book - otherwise do as Mr Brown suggests and take a city tour to kill some time, you will still be at the airport in the early afternoon; or just DIY, dump the luggage at the station, and then catch a cab to the airport when you are ready around 7.30pm for €30 approx.