"Should" is one of those words that means less and less the more you look at it.
One way to define it is, "Do employees like it?"
If you accept the premise that markets are good at finding optimal prices where "optimal" means "greatest aggregate satisfaction of all participants", and you believe that the job market is relatively efficient, then it means you can trust the job market to answer your "should" question for you.
(It's OK to not accept these premises, of course, or to partially accept them. Personally, I think the job market is somewhat efficient. There are lots of both buyers and sellers. There is a fair amount of information available to all participants. However, switching costs are pretty high, which artificially disincentivizes job hopping.)
You might assume that employees would not like it because they'll get paid less in a cheaper area. But employees in more expensive areas will get paid correspondingly more. And, if your goal is to maximize total happiness across all employees, you'll probably find that yes, it makes sense for salary to vary based on cost of living.
Another definition is "Is it good for society?" In other words, what incentives does this choice create, and do we like the consequences of incentivizing that?
Salaries that do not take cost of living into account are essentially pay raises for living some place cheaper and pay cuts for living some place more expensive. That incentivizes people to move to cheaper areas.
That could be a good thing for the US. Ever since our ag industry automated and our manufacturing industry moved overseas, we have lost most of the forces pulling people towards smaller cities. The result is an increasing concentration in a few metro areas not designed to handle that population. This in turn creates a bunch of knock-on effects: greater homelessness, greater economic sorting where people rarely interact with people outside of their economic level, and increasingly painful commutes for lower income people.
An incentive to mitigate that and encourage Americans to move out of the big cities could be a good thing.