In Bava Metzia 30b, we are told that Jerusalem was destroyed because its people decided legal issues amongst themselves precisely according to the letter of the law, without going beyond the letter of the law. Therefore, Ha-shem, in turn, judged them according to a strict sense of justice without compassion.
Isn't this contradictory to that which it says in Yoma 9b that Jerusalem was destroyed because of sinas chinam?
Although there are many approaches to this question, I feel the most simple is that the Aveirah for which they were punished was indeed Sin'as Chinam. However, had they acted "Lifnim mi'Shuras ha'Din," Hash-m would have also gone "Lifnim mi'Shuras ha'Din" and they would have been saved Midah Keneged Midah.