Borrowed from Latin vitium. Doublet of viço, probably a semi-learned term, and vezo, which was inherited.
vício m (plural vícios)