Why is liberty a virtue?

“Being free is important, because only free people can really act ethically. Doing something one is forced to do by threat of punishment isn’t acting ethically.”

i think this is spot on. If so, does it imply that liberty is the means to virtue (and of course, vice)? Or in others, can virtue only exist because of liberty?