Moses mentions here, as is his wont (compare Leviticus 24:10-16), the first open transgression and its punishment in order to exemplify the laws which he is laying down. The offence of Sabbath-breaking was one for which there could be no excuse. This law at least might be observed even in the wilderness. Transgression of it was therefore a presumptuous sin, and was punished accordingly.
Related Commentaries of Numbers 15:32
Numbers 15:32
32 And while the children of Israel were in the wilderness, they found a man that gathered sticks upon the sabbath day.