The simple understanding is that the celebration is because Hashem took
revenge on the killer and showed everyone that He avenges the blood of his
beloved. But why is it fitting to institute a day of celebration on the day
of that the righteous Papus and Lulianus were put to death? If they would
have come out alive, then there would be reason to celebrate. But why should
we celebrate if they were killed -- does the show of Hashem's vengeance
somehow outweigh the tragedy of their execution?
(a) RASHI explains that, initially, there was a Gezeirah to destroy *all* of
the Jewish people. Through the martyrdom of Lulianus and Papus, the rest of
the Jewish people were saved. It is *that* salvation which we celebrate on
Yom Taryanus.
(b) The DIKDUKEI SOFRIM records a different text of the Gemara from a
manuscript which omits the words "nevertheless he killed them." According to
that Girsa, Taryanus did *not* succeed in killing them before his sudden
death. This is also the way the incident is recorded in Megilas Ta'anis (ch.
12) and in Toras Kohanim (Parshas Emor, ch. 9). Since the evil ruler was
killed before he carried out his plans to kill the Jews and they were spared
miraculously, the Chachamim enacted that day to be one of celebration.
According to this explanation, we can understand the Yerushalmi which says
that the Chachamim cancelled the celebration of Yom Taryanus when *Lulianus*
and *Papus* were killed (and not Shemayah and Achiyah, as our Gemara says a
few lines earlier). That is, the Yom Tov was instituted when they were saved
from the hands of Taryanus, and it was annulled when, some years later, the
same two righteous people were killed by another governing body. This might
also be the intention behind the words of the Aruch (recorded in the margin
of our Gemara) when he writes that Shemayah and Achiyah were the Harugei Lud.
Does the Beraisa not say that Lulianus and Papus were the brothers killed in
"Ludkia" (= Lydia; or Lud, as Rashi explains, see also Midrash Koheles Raba
9:8)? It must be that Shemayah and Achiyah were the Hebrew names of Lulianus
and Papus. (Based on YEFEH EINAYIM)
The YEFEH EINAYIM also cites the exact circumstances under which Lulianus and
Papus were eventually killled. He refers to the Yerushalmi (Shevi'is 4:2)
which states that Lulianus and Papus were killed when they refused to drink
from a cup that the emperor gave to them, upon which was inscribed the name
of an Avodah Zarah. This occurred at a later time, after the miraculous
incident with Taryanus. Apparently, when they were killed by the new emperor,
the Chachamim annulled the Yom Tov which had been instituted because they
were saved from the old one.
(According to this approach, it must be that Megilas Ta'anis was written
during the lives of Lulianus and Papus, shortly after the destruction of the
Temple, and that is why it records the day as a Yom Tov -- see Shabbos 13b.)