Sugar is used to cover up excess salt not instead of salt. They are counter flavors that tend to cancel each other.
Sugar and salt can both extend shelf life as well so increasing both can increases shelf life without changing the flavor much.
They also both make you thirsty so soda manufacturers tend to increase both in sych to keep the taste about the same but make the soda far less thirst quenching.