UK has EU immigrants and Commonwealth immigrants. EU immigrants are mostly Poles. They are very likely to go back to Poland once they have earned enough money. Commonwealth immigrants are mostly from India, Pakistan, Bangladesh and Nigeria. They are there to stay. Brexit would block off the Poles, but letting in immigrants from Commonwealth was never about the EU.
It is a good question though; why didn’t Cameron and his government cut back on Commonwealth immigration? Why doesn’t the current government do it?
I’m glad Brexit passed, and I’d like to see other nations leave the EU, but it seems mass immigration from Pakistan, Bangladesh, and Nigeria are much bigger long-term demographic threats than immigration from Poland and Eastern Europe.