Hakim al Umma Mawlana Ashraf Ali Thanawi (Allah have mercy on him) said,
‘One should not criticize the Shaikh if he infrequently commits something questionable.
One should remind himself of the story of Sayyedina Musa and Khidr (Allah’s peace be upon them).
Either make an excuse or recall that friends of Allah (awliya) are not infallible. Moreover, with repentance all (sins) are forgiven.
However, this is for the Shaikh who is steadfast on Shariah and is firmly rooted (in piety) and it is an (isolated) act (of disobedience) committed accidentally. If this individual has made the acts of disobedience (fisq o fujoor) his habit, openly and in secret, then he is not a friend of Allah (wali). There is no need to make an excuse for his speech and actions. One should leave him.’
Taleemud Deen, page 126-7