I'm sorry, but I really don't care, it was a terrorist hotspot, you could pretty much say it still is, where do the terrorists targeting Pakistan come from? It was necessary, no matter what angle you look at it. It was the right decision, it's not our fault if Afghans are in denial of the terrorist safe haven their country became, and is, and then the leakage of terrorists into tribal areas of Pakistan.
And your idea is, the problem already exists, so let's make it worse by increasing the intensity. The moment you officially allow it, they will flood in 10 folds more. Sectarianism and terrorism may exist now, but it will be nothing in comparison to what it could become if Afghan refugees flood in.
And yes, it is the job of our security agencies, and you can see how they are currently handling it, do you think it's a wise decision to make their job that much more harder?
It is very possible to handle their migration but Pakistan is nowhere near competent enough for that, it will backfire to decades of instability.