No one knows for sure why Malcolm X was killed. The most common assumption is that he was killed because he had broken away from the Nation of Islam and was seen as a threat to their importance and to the supremacy of Elijah Muhammad in the African American Muslim community.
The belief is that Malcolm had grown too much in stature and was becoming a threat to Elijah Muhammad. Muhammad and his followers were trying to push Malcolm aside. It was largely for this reason that Malcolm left the Nation of Islam. However, it is believed that his continuing fame and influence led three men who were connected to the Nation of Islam to kill him.
He returned to the united states to give a speech in new yourk city. while giving the speech he was interupted by a man yelling "get your hands out of my pocket: dont be messing with my pockets!" immediaely after this a man came forward and shot malcolm killing him.
2 men were arrested on the scene, as they claimed to have killed malcolm-Norman X and Thomas X. however, police arrested Talmadge Hayer the next day and he was found guilty of assassinating Malcolm X.
hope this helps, learnt this in history lesson.. :)