Further, the disappearance of walls does not coincide well with developments in weapons technology. Walls adapted to the introduction of gunpowder and explosives, with fortresses being key parts of strategy well into the 20th century. Even medieval fortifications with minimal upgrades still proved reasonably effective in modern conflicts. Walls are very good for their intended purpose.
The disappearance of city walls was not due to technological but rather social progress. The early modern period saw the development of strong central states able to field large armies. These states did not want a lot of fortified cities that could close themselves off easily from either a foreign invader or from their own government. Instead the national army would defend cities as needed, operating from fortresses in strategic locations and setting up temporary fortifications as needed. Cities were redesigned to make it easy to march an army into them. At the same time, population growth and changing economic systems meant cities rapidly grew, far outstripping the limited space available within medieval walls. Again, detached networks of mutually-supporting forts were simply more economical than contiguous walls. Finally, the changing world meant that you were simply no longer worried about wandering war bands pillaging settlements. Most of what walls were needed for could be done more economically with fences and legal markers.