Why did they build their homes in such difficult to reach locations?
The Pueblo Indians were surrounded by many nomadic tribes which are revered for their fierce fighting skills. Today we collectively call those tribes "Apachean" and/or Navajo. The Pueblo Indians were agricultural and according to the Spanish, they were very peaceful. Spanish missionaries built churches amongst them and early European settlers traded with them with few problems. (They was an Indian uprising at Acoma in the 1500s and the friar was killed after he abused the Indians for many years by eating too much of their scarce food, but it appears to be the exception). The choice of building structure is defensive and was very successful until the arrival of the Spanish. The Pueblo Indians chose defense rather than to engage with the fierce warrior tribes surrounding them.
One consideration is that, logistically speaking, trading networks always require caches or vaults in order to temporarily store the commodities travelling along the network. These vaults must be secure in order to avoid loss from theft.
Archaeology shows that for the most part, these stone dwellings were not dwellings at all. That is to say, they stored maize instead of serving as lodgings.
Although from our perspective they might look defensive to an almost paranoid degree, in fact they are as likely to have been quite an aggressive installation. In the same way that the Normans built strong fortresses in Ireland and Britain in order to subjugate it, these vaults of maize might have tied together a trading network meant to control large sections of the American population.