First, depending on the food we’re talking about, salt might be an inherent part of the process, either of canning in particular or just the food in general. Pickles? Olives? Gotta have salt. Salt is also a critical ingredient in any number of fermented foods, many of which are canned.
Second, salt is a flavor enhancer. Processed food manufacturers have tended to add loads of salt to a wide variety of foods for the better part of a century as a way of making their products tastier. Canned foods are hardly unique here.
Third, while canned vegetables are certainly saltier than their raw counterparts, they’re not necessarily as salty as you might think. One 30g slice of white bread has a little less than three times as much sodium as 28g of canned green beans.
Fourth, while canning certainly tends to kill biological organisms, it’s not magic. Some organisms are merely weakened. Some may even survive, though in small enough numbers that they can’t cause a problem if the food is eaten within a year or two. A little salt goes a long way towards ensuring that fewer bacteria survive, and those that do stay dormant.
But lastly, bacteria aren’t the only things that contribute to food spoilage. There are other chemical processes that have nothing to do with bacteria that can make food go bad, or at least lose quality over time. Discoloration comes immediately to mind, but that’s not the only thing. Flavors can change. Textures can break down. Foods can take on flavors from their containers. Salt creates an environment inhospitable to bacteria, to be sure, but it also tends to interfere with some of these other processes, making it useful as a preservative even in a largely sterile environment.