The function of vice is to keep virtue within reasonable bounds.
Samuel Butler (2014). “The Notebooks of Samuel Butler”, p.47, The Floating Press

The function of vice is to keep virtue within reasonable bounds.