… is from page 265 of F.A. Hayek’s December 1961 speech in New York City titled “The Moral Element in Free Enterprise,” which appears as chapter twenty of Essays on Liberalism and the Economy (2022), which is volume 18 (expertly edited by Paul Lewis), of The Collected Works of F.A. Hayek:
It is true that a free society lacking a moral foundation would be a very unpleasant society in which to live. But it would even so be better than a society which is unfree and immoral; and it at least offers the hope of a gradual emergence of moral convictions which an unfree society prevents.