A retired Court of Appeal judge who was once accused of “social cleansing” has been appointed to lead the public inquiry into the Grenfell Tower tragedy.