Because we evolved to crave salt.
Plants don’t need sodium. But animals do. Since plants don’t need it, they don’t absorb it from the soil, and they don’t store it. As a result, animals that get most of their calories from plants need to find other things to eat that do contain sodium.
Some soils contain salt, and of course the ocean does. Animals have evolved taste sensors to tell them what things contain salt, and the brain has evolved to make eating salty things pleasurable, so that animals will eat salty things, even if there is no other food value associated with them. Animals will walk miles to get to salt licks.
Humans are no different. We need salt, and our brains send pleasure signals when we get salt, just as we get pleasure from sweet things. And, just like sweets, people who make foods know that if there is more salt (up to a point) people will like the food more.
As the makers of food compete with one another for the consumer’s money, they find that consumers buy things that are saltier. So the food makers add salt, so they can make more money.
Even in the home, most people salt their food with more salt than they require in their diet, just because they have evolved to like the taste.