(Devarim 32:50) "And die on the mountain which you are ascending": Moses said before Him: Why should I die? Is it not better that they should say "Moses is good" by sight than "Moses is good" by hearsay? Is it not better that they say: This Moses, who took us out of Egypt and split the sea for us and brought the Torah down for us and "flew in" the quail for us and performed miracles and feats of might for us, than "This and this is what he did"? and "This and this is what he said"? — whereupon He said to him: Leave off, Moses, this (i.e., death) is a decree for all men, viz. (Bamidbar 19:14) "This is the law: A man if he die in the tent."
The ministering angels said before the Holy One Blessed be He: L-rd of the universe, Why did Adam die? He: Because he did not keep My commandments. They: But Moses kept Your commandments! He: It is a decree before Me for all men, viz. "This is the law: A man if he die."