Answer:
D. Thoreau regrets conforming to the expectations of others.
Explanation:
The figure of speech he is using is irony - he says that he behaved so well even though he considers that behavior to be bad. His neighbors, or rather the people around him, behave a certain way that Thoreau doesn't really approve of. However, in order to conform, or fit in with the rest of the society, he behaved in the same way they did, which made him disgusted and want to repent after having betrayed his ideals.