Sometimes not willingly but due to past bad habits-habit is second nature-one does something nonsensical. But that does not mean he is faulty. But he must repent for that—"I have done this." And he should try to avoid it as far as possible.
Reference: Perfect Questions, Perfect Answers : Chapter 7