They brought out Rabbi Akiba... and lacerated his body with sharp pointed iron combs.
The Romans summoned the ten Sages and inquired, “What is the law regarding one who kidnaps a person and sells him as a slave?” They answered, “According to Biblical law, the perpetrator should be put to death.” “If so,” the king exclaimed, “this punishment should have been meted out to the brothers who kidnapped Joseph and sold him into captivity, and now it is you who must bear the sin of your forefathers.”
The martyring of the ten Sages was done by the Romans as a punishment for the brothers kidnapping and selling of Joseph.
When Josef was sold, only nine brothers were present (Reuben had returned home and Binyamin did not participate). Why were ten Sages killed?
According to the Midrash's account the brothers had agreed not to reveal to Jacob the whereabouts of Joseph and had made G-d a party to the agreement.1 The Roman King thus calculated that ten (counting G-d) had cooperated in the kidnapping, and therefore he killed ten Sages.
Commentaries ask why Rabbi Akiba was among the ten Sages killed since he was a descendant of converts and his ancestors had taken no part in the kidnapping.
The answer given is that Rabbi Akiba was punished on behalf of G-d, who participated in the kidnapping by not revealing to Jacob the whereabouts of Josef.2
Why was Rabbi Akiba selected to be the one martyred on behalf of G-d?
The Talmud3 relates that when Rabbi Akiba stidied the verse, “G-d, your G‑d, shall you fear”4 -- he learned from the extra word in the verse that the commandment includes the fear one should have for Torah scholars.5 Since it was Rabbi Akiba who equated the fear of Torah scholars with the fear of G-d, he was the one selected to represent G-d.
The Talmud6 relates that while Rabbi Akiba was being put to death, he recited the Shema prayer, and when he said the word "One"--echad--he expired. A voice emanated from heaven and said, “Lucky are you, Rabbi Akiba, that your soul went out with One."In light of the above, we may say that the voice also meant, Lucky are you Rabbi Akiba that your soul went out on behalf of One -- G-d -- the One and only One.7