snow like foam on the walls
You did not mention what the walls are built of, but I would gues they are some unfired or partiall fired clay brick that is common in India and Pakistan. A second guess would be some kind of a low qualty concrete/pressed dirt block. In either case, the white deposit is called efflorescence, which is formed when water comes to the surface and evaporates and leaves the salt deposit.
I assume most of the walls are interior, but one is obviously a privacy/security wall.
The salt crystals are expansive and can deteriorate the surface (plaster/stucco in your case) and possibly the wall material. The source of the salt could be from the plaster or from the wall materials. Water is the vehicle that dissolves and carries the salt to the surface.
You should get rid of the water in the wall. The source could be absorption and capillary action from below as suggested or from leakage above if you have significant rains. My geography memory is poor, but I do recall being in some significant rains in the south.
In your part of the world, replacing a portion of the middle of a wall is not unheard of. If you do replace, make sure you are not just creating the same problem and situation again. Get several opinions on the suggested repair AND find out what the real cause is, and how they would prevent the same thing from happening again.
Your method of construction is the standard of construction for most of the developed world with minor exceptions (U.S., Canada and maybe Tonga). There are definitely ways to build in your area that will last for centuries.
Without seeing it and getting mor details of the entire home complex, it is difficult to make any more detailed suggestions.