Because ye trespassed — God reminds him of the sin he had committed long before. It is good for the holiest of men to die repenting, even of their early sins.
Related Commentaries of Deuteronomy 32:51
Deuteronomy 32:51
51 Because ye trespassed against me among the children of Israel at the waters of Meribah-Kadesh, in the wilderness of Zin; because ye sanctified me not in the midst of the children of Israel.