I think there are a few reasons why St Andrews is so highly regarded in the US, which include:
1. They began recruiting students at some of the absolute top prep schools in the US roughly 30 years ago and this has helped raise their profile. Many of the students who matriculate at St Andrews have also been accepted to Ivy League/Top 20 institutions in the US. They tend to rave about the place, billing it as a Scottish Ivy, and this in turn contributes to St Andrews' prestige. In short, some of the best students from the US attend St Andrews, love it, and tell their friends.
2. Prince William and a number of other high-profile people have attended St Andrews over the past five years and this represents the equivalent of a celebrity endorsement, attesting to its quality. If Americans hear that the future King attended St Andrews then they're left with the impression that it's a premier institution (in my opinion, it is...).
3. St Andrews has one of the best IR programs in the world and Americans are made well aware of that fact. The largest proportion of Americans at St Andrews study IR and many view it as a solid alternative to Georgetown, Columbia, etc. Further, it has exchanges with Princeton, Georgetown, University of Pennsylvania, and Emory that help its reputation in the US.
4. The place is truly unique, with all sorts of ancient traditions, and Americans enjoy the ambiance. St Andrews is a small community with amazing beaches, medieval architecture, and lots of charm. Robes, balls, garden parties, beach parties, etc. are appealing to some Americans.
5. St Andrews is home to some of the best golf courses in the world, including the Old Course. Americans tend to view golf as a wealthy/posh sport and St Andrews is the Mecca of golf. Much of the prestige associated with the town is also applied to the university.
6. One finds some amazing, small liberal arts colleges in the US and St Andrews is in many ways reminiscent of these institutions. The major reason why St Andrews isn't routinely in the top five is its size. The rankings tend to place a high value on research, but overlook things that places like St Andrews do very well. Liberal arts colleges tend to value teaching, student interaction, and personal development. Americans like the personal attention that comes with this more intimate, student-oriented environment.