Joseph was killed for the doctrines he preached, (and for those he preached privately as well). That is the very textbook definition of martyred.
This has been rehashed over and over again and those like JLH who are apologists for Joseph Smith always claim he was martyred. And Joseph was not simply killed "for the doctrines he preached". There was a whole underpinning of political shenanigans going on at the time that fed the beast. Joseph was killed because of his political influence. The main person who stirred up the opposition to Joseph (Sharp) was little concerned with Joseph's religious doctrines, except to use them to show that he was a hypocrite. All of those that Mormons later claimed were involved in the murder for religious reasons were not.
Why was Joseph even IN Carthage? Because of the Nauvoo Charter and Joseph's dictatorial powers in Nauvoo and his misuse of habeas corpus. Walmart. Law and others saw how Joseph exploited his power as Mayor in the case of the Expositor to give himself a pass on the charges. Therefore, they went to Carthage. Others KNEW that he would be vulnerable there and took advantage of it, like Thomas Sharp, who goaded the militia into killing Smith.
One week after noting that the Nauvoo charter had been granted, Sharp reported on the Prophet Joseph Smith’s call for new converts and other Church members to gather to Nauvoo. Later, such calls would provoke outrage and fear from Sharp because the growing political and economic power of the Mormons threatened to overwhelm the old citizens of Hancock County. ... Along with the crystallization of Sharp’s fears about the political power of the growing number of Mormons in Hancock County, the Mormons kept stirring up the issue by attacking Sharp through their newspaper, the Times and Seasons.
This article is very informative on why Sharp turned against Smith and what his main objections to Smith were. It was in no way religious persecution that drove Sharp, it was Smith's power and influence in using his role as a "holy" "prophet" to dictate the political affairs in the State of Illinois. Of course Sharp used what Bennett and others revealed as a cudgel against Smith.
https://www.sunstonemagazine.com/pdf/073-16-23.pdfThis was Ohio and Missouri all over again. Sharp, like those in Missouri and Ohio was mainly concerned with the influence of Mormons on their societies and that the Mormons were dictating the terms and laws of the land. Smith attacking Militia, Smith starting illegal banks, etc. etc. did nothing to help himself. The Mormons have made this all about "religion". It was not. It never was.