There is nothing wrong with this. The guy is being held for no good reason as he identified the number 1 most wanted man who had killed many, including Pakistanis (and his people are still killing Pakistanis where possible).
Trump made this a campaign promise. If both Pakistan and the US can work together, say Pakistan releases this person and the US goes all in to resolve the Kashmir issue, and establishes good, trust worthy relationship further strengthened with serious economic investments into Pakistan, I can see a future, long term strategic relationship being formed. I think that's a win win for everyone. A trusting and strategic relationship would be very beneficial for Pakistan, specially if it helps resolve the Kashmir dispute. That saves millions of more lives, who'd otherwise be in danger due to brutalities happening in that region and the fear of a serious war.