Why does salt prevent soy milk from curdling in hot coffee?
I can't find any definitive answers to this question online. All the discussion I could find are speculation.

Factors that cause soy protein to coagulate are heat, acidity, and the presence of magnesium or calcium salts. Additionally the proteins are more likely to curdle if they are heated very quickly.

I will assume that you heated your coffee and milk identically with and without the salt. If you had changed the order of adding boiling water, for example, it could have prevented your curdling.

If you have hard water then there will be a good amount of calcium salts in your water. Coffee itself also has a good bit of magnesium. These salts will coagulate soy proteins more readily than acidity.

Sodium chloride does not cause soy proteins to coagulate. Sodium chloride ions will replace calcium ions- this is used in water softeners and soaking beans.

My suspicion (which to prove would require more experimenting than I have time for right now) is that the sodium ions are preventing the calcium and magnesium ions from coagulating your soy proteins.