Countries that are geopolitically important and politically unstable

How should the United States deal with countries that are both geopolitically important and politically unstable, such as Pakistan?  Does the U.S. need for political allies outweigh its role as a good neighbour and role model?