Lupercalia was a typical Roman festival: its original function was surely to protect the flocks (just how important sheep and goats were to the primitive Romans can be gauged by the word pecunia, money, closely tied with pecus, sheep) from the wolves.
But after the terrible slaughter of the Second Punic War, when pureblood Romans are said to have become extinct, the exact origins were lost. Nobody seemed to remember when the festival started, which deities or heroes were thus honored etc.
The sacred festival thus turned into a festive occasion, when markets were held, bread and wine offered by the rich to their "clientes" etc.
The festival followed where Rome's armies went but it never really caught up with the conquered populations. It was just another occasion to drink and be merry.
One of the customs that foreigners (be them Celts or Greeks) found more repulsive was a lottery where the name of available (ie unmarried) maidens were placed in a ballot box; the young man drew from the box and the maiden was to be his "wife" for the day.
Lupercalia was one of the last pagan festivals to be eliminated: it was held for the last time in Rome (long after it had disappeared from the rest of the former empire) in 496, thus outlasting the last "Roman" ruler by twenty years.