In ancient Rome, libertinus denoted a slave who had been liberated, a freedman, and this was the meaning of libertine in early English use.
But, just as a schoolboy released from irksome confinement of school is likely to break all bonds in his exuberance, so it was found that those released from slavery were likely to show no restraint in the observance of moral laws.
Thus it came to be expected that a libertine would lead a life of unbridled license, and it was in this manner that the term came to refer to anyone, whether ex-slave or not, who lived such a life.