From the Wikipedia:
"Since Legenda Aurea still provided no connections whatsoever with sentimental love, appropriate lore has been embroidered in modern times to portray Valentine as a priest who refused an unattested law attributed to Roman Emperor Claudius II, allegedly ordering that young men remain single. The Emperor supposedly did this to grow his army, believing that married men did not make for good soldiers. The priest Valentine, however, secretly performed marriage ceremonies for young men. When Claudius found out about this, he had Valentine arrested and thrown in jail."