The kingdom of heaven is like what happens when someone finds treasure hidden in a field and buries it again. A person like that is happy and goes and sells everything in order to buy that field.
Moses knew that the treasures of Egypt were not as wonderful as what he would receive from suffering for the Messiah, and he looked forward to his reward.
Buy your gold from me. It has been refined in a fire, and it will make you rich. Buy white clothes from me. Wear them and you can cover up your shameful nakedness. Buy medicine for your eyes, so that you will be able to see.