I have done some research and realise what you are talking about.
Nothing is illegal about it and there are no ecological downsides to it.
In fact it is used very widely by man in degraded areas and occurs naturally in nature.
The way its used depends on the topography, so I will deal with 2 easy ones, slopes and flat country.
IN FLAT COUNTRY WHERE OVERGRAZING AND WIND HAS DESTROYED AND BLOWN EVERYTHING AWAY, a single row of rocks garnered from THE degraded
land
can catch dust,
organic matter, seeds and
water to just improve the small area upstream of the rocks.
Over time things get better. If many of these 'walls' are established the area can improve.
If a plant like vivtar is added later, its very deep rooted and resilient and will improve the catching ability of the system.
In some areas, small hat sized holes will also be dug to catch and hold water, dust and organic material that enables food to be grown over time.
SLOWLY and Slowly the area will improve.
ON SLOPES FAST MOVING WATER IS THE PROBLEM
Once water gets to about 4 feet per second velocity it can pick up or roll soil particles and thus erosion starts.
By building walls of any type, the water can be slowed down, sediment will stop eroding and drop in to the water
course.
As the wall is added to the process slowly improves the water table and the soil quality.
This Video shows some of the techniques I am speaking of.