Bamidbar14:44

וַיַּעְפִּלוּ לַעֲלוֹת אֶל־רֹאשׁ הָהָר וַאֲרוֹן בְּרִית־יְהוָה וּמֹשֶׁה לֹא־מָשׁוּ מִקֶּרֶב הַמַּחֲנֶה׃

But they presumed to go up to the top of the mountain, while the ark of the covenant of the Eternal and Moshe did not move from the midst of the camp.

Bamidbar 14:44

וַיַּעְפִּלוּ לַעֲלוֹת אֶל־רֹאשׁ

Bamidbar / Numbers 14:44 · Sod

Bamidbar 14:44

וַיַּעְפִּלוּ לַעֲלוֹת אֶל־רֹאשׁ הָהָר וַאֲרוֹן בְּרִית־יְהוָה וּמֹשֶׁה לֹא־מָשׁוּ מִקֶּרֶב הַמַּחֲנֶה׃

But they presumed to go up to the top of the mountain, while the ark of the covenant of the Eternal and Moshe did not move from the midst of the camp.

Sod סוֹד

Counted as done

You very much wanted to do a good deed but could not. Is your wish lost?

Rabbi Naftali of Ropshitz: this was the generation of knowledge. When they understood that they had sinned and wanted to return, they wanted to enter the land not for its fruit and the pleasures of this world but to keep the commandments that are kept only in the Land of Israel. But the wisdom of the Eternal decided that they could no longer enter. So right after this He gave them commandments tied to the land, to reward them for the thought: one who intended to do a commandment and could not, Scripture counts it as if he had done it.

How Zera Kodesh explain it

Zera Kodesh And they presumed to go up the mountain, and said: "We have sinned" (Bamidbar / Numbers 14:40, 44)

Now surely this was the generation of knowledge. All the more afterward, when they understood and knew that they had sinned, surely, when they wanted to repent and said "we have sinned," their intention was not to go up to the Land of Israel to eat its fruit and enjoy this world, but only to keep the commandments that depend on the land. But His wisdom decreed that they could no longer come to the Land of Israel. And right after this He gave them a commandment that depends on the land, to give them a reward for their thought of keeping the commandment as they wished. As our sages, of blessed memory, said: one who intended to do a commandment and was prevented and did not do it, Scripture counts it for him as if he had done it.

Takeaway

"The generation of knowledge" (דּוֹר דֵּעָה) is what the sages call the generation of the wilderness, which saw the Exodus and received the Torah at Sinai.
Right after this story the Torah sets out the laws of the offerings to be brought "when you come into the land" (Bamidbar / Numbers 15:1–21).
The sages' words "one who intended to do a commandment and could not" are in the Talmud (Berachot 6a, Kiddushin 40a).