This is an interesting topic, with both amusing and serious sides. The posts above are, so far as I know, about as accurate a discussion of the practice's origins as one can find (i.e., nobody's quite sure how it got started).
One aspect that hasn't been mentioned in this thread is that the use of feminine pronouns for ships is far from universal - even among romance languages. French, for instance, doesn't seem to make any such connection. In the French nautical texts I've seen, the pronouns for ship names are either masculine or feminine (French has no neuter pronouns) depending on the name of the ship. (E.g., the Jean Bart and Richelieu are "he's.")
I also remember reading in Baron von Mullenheim-Rechberg's memoir about the Bismarck that her (his?) captain, Lindemann, issued orders that the Bismarck was to be referred to as "he." That implies that the feminine pronouns are the norm in German. But would any British or American officer even think about issuing such an order - and would any of his subordinates take it seriously?
It would be interesting to hear about this from some foreign-language-speaking members of the Forum. I have no idea, for instance, what the Asian languages do about gender when they refer to ships.
In recent years I've had to do some research and writing on commission from the U.S. Coast Guard Historian's Office. I've been informed quite emphatically that the Coast Guard views the use of feminine pronouns for ships (or boats, or aircraft) as sexist. A few years ago the Coast Guard went through some serious problems regarding gender discrimination, one tragic byproduct of which was that the captain in command of the CG Public Affairs Office, confronted with an investigation into his allegedly sexist behavior, committed suicide. Another consequence is that since that controversy Coast Guard vessels have officially been "its." (It's worth noting in this context that the Coast Guard has, in general, been ahead of the other American armed forces in its policies toward women. The Coast Guard Academy was the first of the service academies to admit women, and the first American warship commanded by a woman was a Coast Guard patrol boat.) So far as I know, the Navy has no such rule regarding pronouns in its publications.
When I mention the Coast Guard policy to nautical enthusiasts and historians I get mixed reactions. Many (including quite a few women - such as my wife, who's a former Marine) roll their eyes and comment that either (a) the policy is ridiculous, (b) it robs the English language of a colorful and harmless tradition, and/or (c) people on the government payroll ought to have better things to do than make rules about stuff like that. Others (including quite a few men) think the tradition is a stupid relic of the stone age and ought to be liquidated as soon as possible.
I confess that, when I have the option, I refer to ships with feminine pronouns - at least in writing. One of my reasons is practical: if a ship and some other object are floating around in the same sentence or paragraph, the neuter/feminine distinction makes the writing easier. ("This is a 24-pound cannon from H.M.S. Victory. It's mounted on her middle gundeck.") I have, however, been accused more than once of behaving like a caveman - for that reason among others.
Stay tuned. It will be interesting to see how this issue plays out over the next decade or two.