“The greater part of what my neighbors call good I believe in my soul to be bad, and if I repent of anything, it is very likely to be my good behavior.”
Henry David Thoreau wrote this in Walden, first published in 1854. It appears in Economy.
Where it appears
The greater part of what my neighbors call good I believe in my soul to be bad, and if I repent of anything, it is very likely to be my good behavior. What demon possessed me that I behaved so well? You may say the wisest thing you can, old man—you who have lived seventy years, not without honor of a kind—I hear an irresistible voice which invites me away from all that. One generation abandons the enterprises of another like stranded vessels.
From the public-domain edition, read it free.