A judge has raised concerns that a large number of immigration appeals heard in the UK courts may have been illegitimate.