Why did the West Africa trade gold into salt?

They didn't trade gold INTO salt, but they traded gold FOR salt because salt is a preservative and is highly needed to preserve meats. Some countries had many gold mines and no salt mines, so gold was common there and salt was rare. In other countries that had many salt mines and no gold mines, salt was common and gold rare. So if these countries traded salt and gold, then they would make a pretty penny and get the goods they needed (or desired).