The US is now afraid that if it distances itself from Pakistan, the latter will fully embrace other Arab/Islamic countries like Iran,Syria and but not the least China. Hence, at the expense of India's displeasure, which it feels can always "deal" with Pakistan when the cruch comes ( which is the moment when India finally reacts viz Kargil), it has adopted the policy to appease Pakistan even if it realizes that Pakistan is a Haven for Terrorists.
On deeper insight, the Nuclear agreement now getting in place would be to appease India for the above policy and also to wean India away from Russia.
The US has always been guided solely by its self interest rather than loyalties or what is 'right' or 'wrong'