The first response is that no one has claimed that grief itself was the virtue. Rather, the virtue is what is indicated by the words of Allah Most High:
“If you do not support him, Allah has already supported him when those who disbelieved drove him out, one of two, when they were both in the cave, and he said to his companion, ‘Do not grieve; indeed, Allah is with us.’” To the end of the verse. [Surah al-Tawbah: 40]
The virtue lies in his being the one who went out with the Prophet—may Allah bless him and grant him peace—under these circumstances, being singled out to accompany him, and enjoying companionship with him in its fullest sense. It also lies in the Prophet’s words to him:
“Indeed, Allah is with us.” (1)
This entails his complete accord with the Prophet—may Allah bless him and grant him peace—his love and tranquility, and his complete support for and loyalty to the Prophet—may Allah bless him and grant him peace. Thus, in (2) this situation, his perfect faith and piety are what (3) constitute the virtue.
His perfect love for and support of the Prophet—may Allah bless him and grant him peace—are what would have caused his grief, if he did grieve, although the Quran does not indicate that he grieved, as explained earlier.
Secondly, the very same argument applies to the words of Allah, Mighty and Majestic, to His Prophet:
“And do not grieve over them, nor be distressed by what they plot.” [Surah al-Nahl: 127]
And His words:
“Do not gaze longingly at what We have granted some groups among them to enjoy.” [Surah al-Hijr: 88]
And other such passages. Indeed, it also applies to the words of Allah Most High to Moses:
“Take hold of it and do not fear; We will restore it to its former state.” [Surah Tā Hā: 21]