The former Conservative leader’s failure on immigration is likely to haunt his successors for many years to come, writes John Rentoul