Herewith the annual millinerd explanation of the surprisingly complex and frequently misunderstood origins of Valentine's Day:
There were some thirteen Valentines in the ancient church, two of which were most popular, both having been martyred on February 14th (probably, therefore, the same person). Their martyr accounts were recorded in the sixth to ninth centuries. Strangely, they have a history of curing epilepsy.
The courtship connection came in the late fourteenth century when Chaucer wrote four poems called The Parliament of Fowls. The poems took Valentine's Day as their theme, and in them the narrator witnesses birds gathering on that day to choose their mates. Other poets borrowed the motif, probably from Chaucer. Thus by the late fourteenth/early fifteenth centuries Valentine and courtship were linked, causing Christine de Pizan and others to try their hands at romantic Valentine's Day poems.
Researchers assumed that Chaucer chose Valentine's day because of the link with courtship, but there is no link between the actual St. Valentine feast on February 14th and courtship that scholars can find before Chaucer. Up until then the St. Valentine cult was only linked with epilepsy cures.
Historian Henry Ansgar Kelly has suggested that the link was made because Chaucer was thinking of Valentine of Genoa, a saint celebrated in a local Italian festival in early May. Chaucer had traveled to Genoa in 1373, and during his traveling he came across the feast day. This must have been what he had in mind when he wrote his Valentinian reflections on courtship. Contemporaries misread the poem, and thereby transplanted springtime twitterpations to winter by associating it with the more popular St. Valentine's Day of February 14th.
In short, don't blame Hallmark - blame Chaucer.
Update: And yet, it's not enough just to point out some historical accidents. For a reconciliation of this early Christian, medieval, and modern mess, I direct you to Matthew Schmitz.
However, more often than not one hears the holiday associated with the Roman festival of Lupercalia. This is because in Alban Butler's eighteenth century Lives of the Saints, the letter of Pope Gelasius denouncing the Roman feast of Lupercalia (celebrated on February 15th) is wrongly thought to have led to the pagan festival being "replaced" by the Pope with St. Valentine's Day. Though that interesting connection is commonly made, it's bogus.
In short, don't blame Hallmark - blame Chaucer.
Update: And yet, it's not enough just to point out some historical accidents. For a reconciliation of this early Christian, medieval, and modern mess, I direct you to Matthew Schmitz.