Because they wanted their own freedom/independence
The walls are thought to have been a symbolic show of authority, designed to preserve the privacy of royal families and set them apart from and above commoners. It is also important to note that the walls surrounded and later adjoined huts made of daga (mud and thatch), linked with them to form a series of courtyards.
I think that it is shared between the national and state government