I think it really depends on the applicant.
For myself, as an older applicant with a family, location was VERY important to us...but not in the "we want a cool city" sense.
Our criteria for "best location" included: Population Size, City Size (in sq. miles, or km if you prefer metrics), Cost-of-Living (including housing costs, utility costs, taxes, etc), Weather, Proximity to Home/Family, Traffic and Commute Time, Crime, Job Market for Wife, Schools for the Kid (Middle, High, and in-state college tuition and acceptance rates...although the higher education was less important since who knows what will happen, but was still considered), "Personality" of the city (does it fit with our personality, i.e. could we live there happily?), Potential Job Market for Dr. Digitlnoize post-residency (and post C&A Fellowship), Friends/Family already present in the area, Culture present or accessible, population growth, economic growth, development, Did the housing market tank when the bubble burst or not, % unemployment, % of residents with higher education degrees, Air Quality (higher pollution, particularly the smaller particle sizes is associated with an increased cardiovascular risk, plus we all have pretty bad environmental allergies, and pollution also makes that worse), and about a billion other criteria.
Oof.
Now, obviously, although we LOOKED at all those things, it really is more of an overall picture. Some things were much more important to us than others. For example, I am still ranking a very large city with horrible pollution and not-great crime pretty highly because despite those negative things, we LOVED the city, and LOVED the program.
So, it really was about a balance of finding the location that was right for my family + the program that was right for me.
Luckily, in our field there are a LOT of GREAT programs. Any program in my Top 10 could have easily been my #1. They're all amazing places that anyone would be lucky to train. So, very minor things wound up differentiating them from one another.
The decision is SO personal that I think it's very difficult to make a judgement of "always pick location over program" or vice versa. Let's look at some example:
Program A:
Academics/Training: Strong
Research: Strong
Work Load: Pushing Limits
Location: Large City in the Northeast
Program B:
Academics/Training: Strong
Research: Strong
Workload: Reasonable, but not slack
Location: Small College Town in the Midwest
Program C:
Academics/Training: Fair
Research: Strong
Workload: Pushing Limits
Location: Awesome/Hip City on a Coast
Program D:
Academics/Training: Strong
Research: Weak
Workload: Light, well-balanced.
Location: Small City in the South
What do you pick? It's up to you. Many people here would probably argue for Program A, the Ivy in the Big City. They might be right, for many people.
For me, and my family, the answer is probably more B and D.
For a young single person, they might like C better.
There are many other permutations of this, but the point is that the decision is VERY dependent on your personal situation and desires. Do you want research? Do you want a Big Name on your CV? Do you want work-life balance? Fellowships? Didactics? Do you learn better by seeing a zillion patients a day, or by having time to read about the few patients you do see? Do you thrive under pressure or collapse under it?
Again, I've been VERY impressed with the variety of options available to aspiring psychiatrists for training. Define what YOU mean by "Great City" and "Great Program" then find the best combination FOR YOU.