The 2-300 year old buildings would be easier to raze and rebuild than to put electricity and plumbing in it, improve resistance to earthquakes, make it safe to live in case of fire or other events that requires evacuation. They were not safe on modern standards.
From the perspective of today the problem was that the families living in the small apartments was way too big and did not pay enough rent to maintain the buildings. They just did not have enough rich single professionals willing to pay chic apartments and studios back then. Or student with rich parents seeking a studio downtown.