It was because he refused to pay allegiance to Yazid who was...
It was because he refused to pay allegiance to Yazid who was nominated Caliph by his father Muawiyyah. Muawiyyah, who belonged to the Umayyad clan was the worst enemy of Ali (P) who, like the Holy Prophet, belonged to the Hashimiite clan. The enmity between the Umayyad and the Hashimiites was proverbial. In the battle of Badr most of the Umayyad were killed and Islam was now on a firm footing.
Abu Sufyan who was always trying to kill the Holy Prophet and destroy Islam, was the leader of the Umayyad. Although later he apparently professed Islam, he was at heart the bitterest enemy of Islam and the Prophet. When Yazid, the vilest of the vile, son of Muawiyyah and grandson of Abu Sufyan, declared himself to be the Caliph of Islam, he got martyred Husayn son of Ali and Fatima, the dearest daughter of the Prophet of Islam.
The fight between Husayn (P) and Yazid (L) was really a fight between Truth and Falsehood, and between Faith and Infidelity .Had Husayn (P) any desire for power, he would not have gone forward to sacrifice his life along with a band of less than hundred of his kith and kin including his children and women. This tragedy occurred within fifty years of the passing away of the Holy Prophet. During the twenty-three years of the Prophetic mission an unparalleled revolution had taken place.
The Holy Prophet suffered extreme troubles in propagating Islam which gloriously spread by leaps and bounds with the support of his real uncle Abu Talib who had nurtured him in his childhood and protected and defended him from his inveterate enemies. After the demise of Abu Talib the Holy Prophet pursued his preaching with his cousin Ali bin Abi Talib (P) at his support, until the task was accomplished in 10 A.H.
It was then that after receiving Allah's command Proclaim what has been sent down to you and if you do not, you would not accomplish the mission at all. -(5 : 67). The Prophet of Islam, returning from his Farewell Hajj, ordered a halt at Ghadir-e-Khum on 18th Zil Hij, mounted the pulpit and taking Ali's(P) hand in his own proclaimed amongst multitudes of muslims. "I leave behind two grand things -Allah's Book (the Qur'an) and my Progeny (Ali, Fatima, Hasan and Husayn). Beware!
how you behave to them when I am gone from amongst you. Both of them will never separate from each other until they reach me in Heaven at the fountain of Kauther".