If you live in a high cost of living area, but are okay living with roommates you can save a ton of money. More than enough to make up the difference compared to living in a low cost of living area.
You also get better quality of life and a lot more opportunities - meeting people for work/friends/dating. It's also better to have a high salary in order to more easily keep a high salary.
I think you also learn more faster from increased exposure to talented people. I grew up in Buffalo which is a nice and very cheap place, but there was nobody to learn from.
Maybe it will be different in my thirties and forties but right now I want to either live in a (cool) city to work on exiting projects or be travelling. It may sound pretentious to some, but it's what I want.
I would imagine quite a few people feel similarly. In that way a campus in New York City makes sense I believe.
In particular, if one anticipates returning to a pricey location later in life (e.g. needing to take care of elderly relatives there), one has to save for retirement at a higher level than if one can stay in the cheaper place forever.
Cost of living comparisons used to justify salary reductions rarely account for such scenarios.
With that said, the numbers can still work out to make it a good financial deal, it's just less automatically true.
But it's not for lots of people who can afford positive savings in both locations, unless the absolute pay difference is less than the absolute difference in CoL at the level they would maintain in each place; even people who would prefer the lifestyle and environment of a cheaper (often rural) place often spend most of their working life in an area with a more robust economy and higher pay and CoL to increase savings, and then retire to the cheaper place. (A lot of the net domestic migration out from CA is, I suspect, that, as people executing that strategy reach retirement.) And that's not to say anything of how that utilities balance for people who actually prefer the lifestyle and environment of the more expensive location.