A vice is a moral failing or a bad habit. Traditional examples of vice include drinking alcohol, smoking tobacco, and gambling in card games.
In the United States, municipal police departments often have a bureau dedicated to vice, manned by vice cops, whose job it is to fight crime related to alcohol, drugs, and gambling. But anything can be a vice, as long as there's someone out there who views it as bad behavior or a moral weakness. You might say, casually, "I don't drink, smoke, or gamble. Chocolate ice cream is my vice." Or driving over the speed limit. Or intentionally failing to sort your recycling.