The first thing I'll say is that the Spaniards being seen as gods is almost certainly a myth that was created after the conquest. You should check out these prior answers here and here for explanations of why it's bogus.
This of course leads back to your question as to why they simply didn't kill them right out the gate. I'm not sure this is a question that is possible to answer. None of the accounts of the conquest that have been published provide a clear explanation as to his motivations. This is complicated by the fact that every single account of the conquest is extremely biased and doesn't really provide a neutral telling of events. Most are written as probanzas which were essentially petitions to the king of Spain to gain rewards or titles. As a result, they tend to wildly exaggerate the role of the conquistadors relative to native warriors in the conquest and stretch the truth to make their victory look miraculous. They tend to go out of their way to make Cortés look valiant, and make Motecuzoma look weak and indecisive.
Take this as an example of the compounding problems: When did Cortés take Motecuzoma prisoner? Most accounts, such as from Cotrés himself, claim that the Spaniards stayed as guests for an extended period and only took Motecuzoma prisoner later once they felt their lives were in danger. On the other hand, Sahagun, who was writing decades later and drawing from the testimony of surviving Aztecs, pushes the claim that Cortés captured Motecuzoma almost immediately upon entering the city. If that's the case, then the answer to your question is pretty clear. He never got the chance; they were holding him hostage from the beginning. Assuming that's not the case, we're left with the scenario presented by Cortés, Diaz del Castillo, and others which describes the Spaniards being taken into the city and placed in one of the palaces in the city center. Motecuzoma initially greets Cortés as an honored guests and offers to house him in one of the palaces.
Restall (Seven Myths of the Spanish Conquest, p.25) indicates that Cortés was actually a prisoner of Motecuzoma at this time, albeit under a kind of house arrest rather than a literal imprisonment. Placing Cortés in one of the palaces may have been an attempt to keep one's potential enemies close. This makes sense, in a way, because the biggest threat posed by the Spaniards came about through them forging alliances with enemies and rebellious subjects of the Aztecs. The use of welcoming, overly generous language by Motecuzoma may have actually been a largely symbolic display to make Motecuzoma seem more powerful. In this instance, Cortés seizing Motecuzoma was a bit like the inmates at a prison seizing one of the guards and holding him hostage. Other factors to keep in mind are that Cortés identified himself as an ambassador of a foreign monarch. For the Aztecs and other Mesoamerican cultures, there was a rigid code of diplomacy which meant that attacking a diplomat of a foreign monarch was effectively a declaration of war. The Aztecs used these rules to their advantage numerous times in their conquest of other city-states, such as sending diplomats to an independent city to behave in a way that provoked a violent response to provide the Aztecs with the causus belli they needed to start a war. Motecuzoma may have seen Cortés as fulfilling the same purpose. Note, for example, that the Aztecs did not directly attack Cortés until after Pánfilo de Narvaez arrived and informed them that Cortés was actually wanted for treason back in his home country. This would have nullified any perceived "diplomatic immunity" and allowed the Aztecs to attack him without provoking a war with this unknown foreign king.
Of course, all of this is informed speculation. The truth is, we can't really know exactly what Motecuzoma was thinking beyond what other people have written down.
If you're looking to get a more detailed treatment of the conquest, I'd recommend the book I referenced above, Seven Myths of the Spanish Conquest by Matthew Restall. Miguel Leon-Portilla's Broken Spears: The Aztec Account of the Conquest of Mexico also provides an alternative perspective derived from later sources written by Nahua (Aztec) historians in the colonial period. Although these accounts are also somewhat suspect, since they're written much later and incorporate a lot of the myths and legends from the earlier primary sources.
Followup question but were the Aztecs on the brink of collapse when Cortez arrived? How was Cortez able to recruit so many other natives to take them on so quickly? When did disease really hit the Aztecs? Was it right when Cortez got to the city?
Somewhat related Question: How did the native people communicate with the Spanish? Is there a record of specific interpreters?