How do you work out that it wouldn't be prohibitively expensive? At the moment, approximately 1% of containers are screened for illegal immigrants. To check all of them would cost 100 times the current budget. Not only that but another group of people here illegally are people who overstay their visas. Seriously, we're talking about billions!
I'm trying to think of the benefits to the economy. Illegal immigrants have to work below the radar. They cannot claim benefits or housing and most are scared to seek healthcare. They work in care, cleaning, catering, agriculture or cannabis farms - mainly cash in hand. Are you seriously saying that people would step in to set up nail bars, etc if all illegal immigrants were weeded out? They might not be contributing to the economy, apart from spending some of their money here, but they're not taking from it either.
Moreover, after Brexit, there will be even more people who will potentially be illegal immigrants. Personally, I really do think that the government could spend money more wisely than creating a UK fortress, which wouldn't stop people finding weak links anyway.