הַכֹּ֞ל כַּאֲשֶׁ֣ר לַכֹּ֗ל מִקְרֶ֨ה אֶחָ֜ד לַצַּדִּ֤יק וְלָרָשָׁע֙ לַטּוֹב֙ וְלַטָּה֣וֹר וְלַטָּמֵ֔א וְלַזֹּבֵ֔חַ וְלַאֲשֶׁ֖ר אֵינֶ֣נּוּ זֹבֵ֑חַ כַּטּוֹב֙ כַּֽחֹטֶ֔א הַנִּשְׁבָּ֕ע כַּאֲשֶׁ֖ר שְׁבוּעָ֥ה יָרֵֽא׃
All things come alike to all; there is one event to the righteous and to the wicked; to the good and to the clean and to the unclean; to him that sacrificeth and to him that sacrificeth not; as is the good, so is the sinner, and he that sweareth, as he that feareth an oath.
Akeidat Yitzchak
Rabbi Ami said in Talmud Shabbat, 55: "There is no death without sin, and no suffering without guilt." When the angels questioned G'd why He had decreed death on Adam, G'd said that He had commanded Adam only one single commandment, and the latter had been unable to handle it. Upon the question why Moses and Aaron, each of whom had fulfilled many hundreds of commandments had been condemned to die, G'd replied that the righteous and the wicked share the same destiny. This is the meaning of the verse in Kohelet 9,2, "the righteous and the wicked share the same fate." In a Baraita Rabbi Shimon ben Eleazar elaborated, "Moses and Aaron died because of their sin."