1. Montezuma thought that Cortez was the god Quetzecoatl. This gave the Spanish the ability to enter the capital and attack from within. Think about it. Is it easier to keep people away or throwing them out? There are no barriers to stop a group inside the capital. The goal of war is to capture the capital. The Spanish didn't loose a man and they achieved this.

2. The Spanish had better weapons. Guns were very primitive at this time, however they were still light years ahead of the Aztec weapons of clubs, bows, arrows, spears, and rocks. The Spanish were better protected with armour. The best the Aztecs could produce was wool tightly bounded together. It was lighter than armour, but it could not handle the force of Spanish steal or a bullet.
3. The Aztecs thought the horse was a god. The horse provided something that the Aztecs never saw in this side of the world. An animal with size, speed, strength, and power. The largest animals the Aztecs were introduced to were deer and jaguars. They were scared of the horse. Now, add on the fact that the Spanish used these horses as calvary, and they become more destructive. Finally, realize that a man sits on top of this god. Psychologically, Aztecs were thinking if this man/god could control a god, which is the horse, how much of a chance would an Aztec have if they had to fight these men hand-to-hand?
4. Disease of the European. European germs and virus' killed more people of the New World than any army. Even before Europeans got off the boat Native Americans were dying. They had no immunity from even the most simple of virus' like the common gold and chicken pox. Many surviving Native Americans put two and two together and realized that if they ran away from the Spanish, they could not kill them with their air.
5. Cruelty and thievery of the Spanish. The Aztecs and all the other tribes of North and South America could not comprehend or compete with the cruelty and thievery of the Spanish. The European wonder lust for gold and riches could not be impeded. Spanish conquistadors would kill, torture, rape, steal, burn to obtain riches. The two main reasons were religion and social placement.
So, when you combine these two, Spanish conquistadors had no problem killing mercilessly.
6. Fighting styles. The fighting styles of the two cultures were in completely opposite. As you can see from the previous point, Spanish had no reservations fighting to kill. The Aztecs however, were a little different. A soldier raised his status in society by capturing the enemy. Aztec religion called for blood for their gods. This blood came from sacrifice. Captured people did well. So, if one culture is purely trained to "shoot to kill," and the other culture is trained to "shoot to capture," the killer culture will win more times than they loose.
7. Treaties with minor tribes. Cortez found out that the tribes on the outer rim of the Aztec empire hated the Aztecs. The constant need for sacrifice, materials, and other taxes made them more than willing to aid the Spanish. Cortez of course promised these tribes the ability to rule themselves and re obtain their riches that were taken by the Aztecs. Of course, once Cortez got rid of the Aztecs he turned his sights on the minor tribes and destroyed them too.