Welding does indeed weaken and damage stainless steel.
The high temperatures cause the steel to melt, depriving the steel of its protective layer.
Therefore, the steel loses its ability to resist corrosion.