After eliminating the causes of moisture, to remove stains in the milder cases it will be sufficient to pass with a spatula or brush with a sturdy brush.
In those cases where the plaster appears to be loose and floury, it will be necessary to remove it with a hammer and chisel until it reaches the masonry.
Clean the wall well with a damp brush and apply the new plaster, possibly more breathable (lime mortar plaster).
Why you create the spots
Moisture causes the salt components of the masonry to dissolve, causing them to be more fragile.
Stains are made up of previously dissolved salts that surface and dry out.
For this it is sufficient to pass with a brush to remove them.