The Yerushalmi here cites the same story that appears in the Bavli, Kesuvos 23. The daughters of Shmuel were taken captive by non-Jews and brought to Teverya. The daughters knew that if their captors presented them for ransom they would be assumed to have been raped and rendered unsuitable to marry Kohanim. They therefore asked the captors to wait outside while they presented themselves in the Beis Medrash, where they stated that they had been taken captives but had not been raped by their captors. They thus met the criterion of the Mishnah there that states that if we only know women were taken captives because they told us so, they are believed to qualify that their captors had not raped them (“ha’peh she’asar hu ha’peh she’hittir). Only after Rabbi Chaninah pronounced them suitable to marry Kohanim, did the captors enter and demand the ransom. Rabbi Chaninah was impressed by the learning of the sisters, who knew how they could remain suitable for Kohanim. He asked their relative Shimon bar Ba to take charge of the sisters.
The story in the Bavli ends here. The Yerushalmi continues the story to a tragic ending. Shimon bar Ba – who was himself a Kohen – married first one of the sisters, who died, and then went on to marry the second sister who died as well. The Gemara makes it clear that this was not, chas v’shalom, because the sisters lied. They had been truthful in stating that they had not been raped. The Gemara blames their death on the sin of Chananiah the son of the brother of Rabbi Yehoshua, who proclaimed a leap year in Chutz la’Aretz, flaunting the law that such proclamations must be made in Eretz Yisroel (the episode is related in the Bavli, Berachos 23a).
The question is why should the daughters of Shmuel be punished for the sin of Chananiah the son of the brother of Rabbi Yehoshua? The Korban Ha’Edah suggests that perhaps they were descendants of the sinner. The Gilyon Ephraim notes that Shmuel had a great deal of respect for Chananiah, and always ruled in accordance with Chananiah’s positions. He speculates that Shmuel may have followed Chananiah in the matter of the leap year, and that is why he was punished through his daughters.