It was, as said in the above two posts an appeasement to the gods. They felt the sacrifices were necessary in order to keep the gods happy and their world going.
The most usual answer for this is that they believed that the blood of the sacrificial victims was needed to keep the universe going. It is said that they believed that the sun needed to be nourished with this blood or else it would be destroyed. They believed that there had been 4 previous suns that were destroyed and that the sacrifices were needed to keep the current one going.
Because they believed it was neccessary to appease their bad-tempered God.
All religions, including Christianity, indulged in human sacrifice in the distant past. It is the ultimate sign of submission and obedience. Kill someone for your God and then your God will favour you. Ancient Gods can be really aggressive if you are not submissive and generous.
A couple of weeks ago I got back from a long trek in the remote mountains of Nepal and while we were there they had a religious festival which involved the ritual sacrifice of hundreds of thousands of goats to appease the hindu god Durga (this number refers to the whole of Nepali population). Durga is a famously over-sensitive and powerful god and you can attempt to bribe her goodwill by killing something in her name. And every year, every Nepalese Hindu family attempts to placate her with the murder of a goat. (or, if you are a rich urban Kathmandu family - a buffalo). Gods aren't always good.
Last year, Kathmandu ran out of goats and some people had nothing to kill, it was a bit of a national scandal...
Why did the Aztecs practice human sacrifice then?