Let me see if I understand the timeline. Your flight gets in to Barcelona at 9 am, and the earliest boarding time for the ship is 3 pm?
Do you have a ship's transfer to the ship that includes sightseeing? If so, that solves the problem. If not, you won't have as much time as you might think. Figure it would be at least an hour to get your luggage in the airport, go through immigration, etc. On their Web site (click here
and go to the next-to-last question), it's stated that you can arrive an hour before the boarding time printed on your documents. But, I understand you also want to see Barcelona.
In any case, don't kick yourself over booking a flight that gets in very early in the day. It's always a good idea to have a buffer in case of flight delays.