When I did a walking tour there the guide said the very narrow and deep form factor of the houses was to do with the way property was taxed at the time. I imagine they're all protected now what with the look of the city being so important for it's tourism industry.