A pirate is a thief on the high seas. Piracy's Golden Age in the Real World lasted between 1650 and 1725 and spawned lots of literature, sea shanties, and folklore. Because of this, the archetype of the lovable rogue and the heroic swashbuckler are now deeply embedded into our culture. Since pirates are mostly a glamorous idea of the distant past, fangirls have a predilection for de-fanging the whole concept of piracy and making it out to be a Glorious Calling of Extreme Liberty and Cool Rebellion Against Authority. Many Mary Sues fall in love with pirates, totally ignorant of what this would realistically mean.
See also Pirates of the Caribbean.