Eventually Pakistan will get the message: don't harbor terrorists who want to attack the United States and the drone strikes will stop. As soon as Pakistan learns to control its tribal region in its border with Afghanistan, the drone strikes will stop. Unfortunately, Pakistani leadership doesn't want to deal with the headache of the country's tribal region and instead focuses their gaze on things happening in Islamabad.
If attacks against US forces are being orchestrated or launched from Pakistan, and the Pakistani authorities are either unwilling or unable to prevent them, then the US is well within its right to launch preventative or retaliatory strikes. Naturally if would be preferable for Pakistan to secure the situation within its own borders, but if that is not possible then the US is left with little choice in order to defend its troops.