I’ve lost the quote now - but someone says above the problem was caused by the EU open door immigration.
This is not true. The UK ALWAYS had the right to refuse entry to those with criminal records, and deport them, regardless of whether they came from an EU country or elsewhere. It is simply not the case that EU immigration was an “open door” to everyone. It was a right to work and reside here for law-abiding EU citizens, who benefited the economy.
That UK border force / police / immigration did not actively check everyone entering the country is bizarre IMO, and I think there may be some truth in the idea that a lot of criminals did come here from countries where they were known, for obvious reasons of anonymity and pastures new.
But that was not the fault of the EU. Try a massively under-funded public sector, including the police and afore mentioned govt agencies.