Why was salt so scarce and valuable when it is in the ocean everywhere?

There are a number of reasons.

First of all, everyone needs salt. Salt deficiency is deadly, and the threat of salt deprivation has been a tool of state power in salt-poor countries since antiquity. If you eat a lot of meat, you probably get all the salt you need to live from other animals. But, until relatively recently, meat was a relative luxury and it would not be possible for common people to live on the salt in meat alone. Salt was used as a medicine, for ritual purposes, and for literally thousands of industrial purposes.

Perhaps most importantly, salt preserves. If you're standing in Barcelona holding a dead tuna, its market value is determined by what someone within about five miles of you is willing to pay for it. But, if you're standing in Barcelona holding a dead tuna and a kilo of salt, suddenly its market value is determined by what someone anywhere on earth is willing to pay for it. If you can't find a buyer, shove it in the cellar and wait for the market to change, or don't sell it at all and eat it a year from now, when it will have lost little or no of its value. You've turned the transient, local, rapidly-declining value of your fish into permanent, global, stable value instead.

This massively increases its potential value and shows the true value of salt in the pre-modern world: turning locally-tradeable, perishable goods into globally-tradeable, nonperishable goods. This is why salt was able to account for, at various times, 60% of the cargo on the Erie canal, 50% of the French king's income, and the primary state revenue source in Imperial China.

Unfortunately, anywhere on earth that does not have a coastline on the ocean or a salt lake does not have the option of evaporating seawater as you suggest. These places generally relied on either mining, brine springs, or trading with coastal areas. But salt is heavy and bulky, and, unless no local option was available, overland trade was generally an impractical way to move salt around until the extensive canal-building in Britain, France, and the New World in the 1800s.

Moreover, not everywhere with a coastline is appropriate for salt production. For one thing, not all parts of the ocean are equally salty, and many are too brackish for salt production to be economical. Also, in temperate climates, just leaving out a big pan of brine will never produce reasonable returns, because cool weather, high humidity, still air, and rain will nullify any progress.

So, coastal salt-producing areas had to have:

  • Highly saline water

  • A warm, windy climate

  • Little rainfall

and, perhaps most importantly,

  • Access to trade routes

Some areas, such as Sicily, the Po Delta, and the Bay of Biscayne are admirably suited. Others are not. Probably the best example of a bad place to make sea salt is Sweden: bordering the brackish Baltic, with a cool, wet climate and long winters, medieval Sweden was forced to either import foreign salt or suck up the slightly more saline deep-baltic waters with vast pipes made from hollowed-out tree trunks, which they would then boil down over wood fires. This consumed even more fuel, and soon much of Sweden was deforestation in the name of cheap salt, which drove prices up and forced the country to rely on imports. In the late middle ages and renaissance, many writers spoke of timber shortages the way people today talk about fossil fuel depletion - ie as a strategic resource that had to be conserved for the good of the state. Thus, brine boiling was impractical in all but a few places.

With 19th century technology, salt production spread somewhat further into temperate areas. Cape Cod and Upstate New York became the salt cellars of the new American republic, reliant of complex covered vats that allowed evaporative salt production in cool northern climates. The vats worked, but they depended on massive manpower to open and close them at the slightest indication of inclement weather. Meanwhile, in the American south, saltworks were able to operate more cheaply due to slavery. In spite of this, the South lagged far behind the north in salt production, and used the vast majority of imported salt. These works - both in the north and south - were only active for a relatively short period of history between the development of temperate-climate evaporation vats and the massive increase in salt mining brought about by 20th century technology, which made them obsolete.

Some parts of the world got lucky, and were able to do exactly as you suggest. In the Sichuan province of China, for instance, underground brine was often found alongside pockets of natural gas. After some trial-and-error, pre-imperial Chinese succeeded in harnessing natural methane seeps to make gas burners, which cooked down brine to a valuable salt. This, combined with its extensive network of rivers, made Sichuan China's salt basket, and one of the few places where the method you suggest was used on a large scale.

Finally, the "salt was worth its weight in gold" thing is probably a myth. It is certainly true that salt was traded for gold, but whether their per-pound values were ever equal has not been established. The misconception likely arose from the Saharan habit of silent bartering, wherein traders would stack up goods on a bartering mat, each adjusting the size of his pile until an agreement was reached. Negotiations could take days, and often the two participants never saw one another. European travelers saw salt-for-gold deals in negotiation, and assumed a parity of value where probably none existed.

Sources:

Kurlansky, Mark. Salt, a World History

Wulf, Andrea. The Invention of Nature

/r/AskHistorians Thread Parent