Epping hotel judge who overturned migrant ruling revealed as chief of socialist think tank linked to Labour