1)
Why did they count the houses of Yerushalayim?
1.
Rashi: They counted how many houses everyone has; each gave rocks and wood to strengthen the wall, proportional to the number of his houses. "Levatzer" is like "Arim Betzuros" (Bamidbar 13:28).
2.
Ibn Ezra: It was to know how many soldiers there are.
3.
Radak, Malbim: One who had an extra house, they demolished it to use the rocks to rebuild the breaches in the wall.