The government seem to be doing what governments are good at. Do every thing the population do not want.
Most people probably voted out because the EU would not listen and would not put some control over immigration. I say control I do not mean preventing or creating state registers.
I agree Human rights also made it difficult for governments to have some control ie to prevent the wrong people getting into a country. How far do we want to control. We will never be able to control everyone and why would we want to.