I believe verses 30 and 31 give the answer. It may even be that the incident in verses 32 - 36 is put in that location to serve as an example of carrying out the commandment in 30-31.
The man violated the sabbath -- knowingly, rebelliously.
30 But the soul that doeth ought *presumptuously*, whether he be born in the land, or a stranger, the same reproacheth the Lord; and that soul shall be cut off from among his people.
31 Because he hath *despised* the word of the Lord, and hath broken his commandment, that soul shall utterly be cut off; his iniquity shall be upon him.
I'm emphasizing "presumptuously" and "despised" because I understand those to be the difference between the violations of the seemingly minor parts of the Law that called for the death penalty and those that incurred much lower penalties, e.g. 4-fold restoration.
Now, the commandment on the sabbath was pretty clear:
Ex 20:10 But the seventh day is the sabbath of the Lord thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, thy manservant, nor thy maidservant, nor thy cattle, nor thy stranger that is within thy gates:
11 For in six days the Lord made heaven and earth, the sea, and all that in them is, and rested the seventh day: wherefore the Lord blessed the sabbath day, and hallowed it.
Before the 10 Commandments were given, Moses taught the people not even to cook or gather on the sabbath. So this was something the people knew very well.
Gathering the sticks on the sabbath seems to be a matter of open defiance of God. And it is given as an example of implementing the penalty prescribed in Numbers 15:30-31.
Unfortunately, we don't always have every detail. I believe that for every law in the OT, there was a sacrificial system that allowed for the forgiveness and repentance of sin. Since that is the case, I presume that this man not only was determined to ignore God's commands, but also not to seek forgiveness. If allowed to continue in rebellion, he would become a infectious carrier of a disease that would destroy the purity/protection that God was trying to build. I'm fully convinced that this man's death could have been avoided if he would have recognized his error and turned from it, but I don't think he did. It wasn't just about "picking up sticks". Sometimes a very small thing, like taking a bite of fruit, can have massive consequences. It was really about open rebellion against God, which is a very big thing that brings death to everything.
This particular Scripture is not about obeying the law,
Nor is the Scripture about repentance;This Scripture is about resting in Yeshua,ceasing from ones own works to becoming saved.
The man picking up the sticks is not faithing / believing about 'resting' in the Sabbath.
The Sabbath was pointing to Messiah,who is our rest according to the Word of GOD.
Heb 3:12 Watch, brothers, lest perhaps there shall be in any one of you an evil heart of unbelief in withdrawing from the living God.
Heb 3:13 But exhort yourselves each day, as long as it is being called today, that not any of you be hardened by the deceit of sin.
Heb 3:14 For we have become partakers of Christ, if truly we hold the beginning of the assurance firm to the end;
Heb 3:15 as in the saying, "Today, if you hear His voice, do not harden your hearts, as in the provocation." Psalm 95:7,8 MT
Heb 3:16 For hearing, some provoked Him, but not all those coming out of Egypt through Moses.
Heb 3:17 But with whom was He angry forty years? Was it not with the ones sinning, whose corpses fell in the wilderness?
Heb 3:18 And to whom did "He swear" "they would not enter into His rest," except to those not obeying? LXX-Psa. 94:11; MT-Psa. 95:11
Heb 3:19 And we see that they were not able to enter in because of unbelief.
Heb 4:1 Therefore, let us fear lest perhaps a promise having been left to enter into His rest, that any of you may seem to come short.
Heb 4:2 For, indeed, we have had the gospel preached to us, even as they also; but the Word did not profit those hearing it, not having been mixed with faith in the ones who heard.
Heb 4:3 For we, the ones believing, enter into the rest, even as He said, "As I swore in My wrath, they shall not enter into My rest," though the works had come into being from the foundation of the world. LXX-Psa. 94:11; MT-Psa. 95:11
Heb 4:4 For He has spoken somewhere about the seventh day this way, "And God rested from all His works in the seventh day." Gen. 2:2
Heb 4:5 And in this again, "They shall not enter into My rest." MT-Psalm 95:11
Heb 4:6 Therefore, since it remains for some to enter into it, and those who formerly had the gospel preached did not enter in on account of disobedience,
Heb 4:7 He again marks out a certain day, saying in David, Today (after so long a time, according as He has said), "Today, if you hear His voice, do not harden your hearts." MT-Psalm 95:7, 8
Heb 4:8 For if Joshua gave them rest, then He would not have afterwards spoken about another day.
Heb 4:9 So, then, there remains a sabbath rest to the people of God.
Heb 4:10 For he entering into His rest, he himself also rested from his works, as God had rested from His own. LXX-Psa. 95:11; Gen. 2:2
Since Messiah is the rest of the believers,this man was not resting,but rather was going about in his own works.
The Word of GOD is not about obeying the law,the WORD is about 'faithing' into Yeshua.
So ... you're saying it had nothing to do with disobeying one of the 10 Commandments? But instead with not "faithing"?
The Pentateuch's prime example of unbelief was at Kadeshbarnea where the people believed the 10 spies rather than Caleb and Joshua. If failure of faith was a capital offense, why were the people not stoned en masse there? Or at least the 10 spies who led the rebellion?
The entire Word of GOD,both the Old Covenant,and the New have always been about faithing into GOD Almighty not about obeying.
A person is able to obey the laws,rules and regulations,yet have no faith in Yeshua the Messiah.
The Sabbath was pointing to the Messiah of YHWH,namely Yeshua,who would be revealed at just the right time.
Hoosier,how is a person saved from the wrath of GOD Almighty by works of obedience,or by faithing into Yeshua the Messiah of GOD?
IF any person is able to be received of GOD Almighty by their own works,then Messiah would have died in vain.
Rom_4:3 For what saith the scripture? Abraham believed God, and it was counted unto him for righteousness.
Gal_3:6 Even as Abraham believed God, and it was accounted to him for righteousness.
Jas_2:23 And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God.
How is a person sanctified,by obedience of by Grace thru faith.
Joh 17:16 They are not of the world, even as I am not of the world.
Joh 17:17 Sanctify them in Your Truth; Your Word is Truth.
Joh 17:18 As You have sent Me into the world, I also have sent them into the world,
Joh 17:19 and I sanctify Myself for them, that they also may be sanctified in Truth.
1Th 5:23 And may the God of peace Himself fully sanctify you, and may your whole spirit and soul and body be kept blameless at the coming of our Lord Jesus Christ.
1Th 5:24 Faithful is the One calling you, who also will perform it.
Heb 13:9 Do not be carried away by various and strange doctrine; for it is good that the heart be confirmed by grace, not by food, in which those walking in them were not profited.
Heb 13:10 We have an altar of which those serving the tabernacle have no authority to eat.
Heb 13:11 For of the animals whose "blood is brought" by the high priest "into the Holy of Holies" concerning sins, of these the bodies "are burned outside the camp." Lev. 16:2, 27
Heb 13:12 Indeed, because of this, in order that He might sanctify the people by His own blood, Jesus suffered outside the gate.
"But the people took some of the spoil, sheep and oxen, the choicest of the things devoted to destruction, to sacrifice to the LORD your God at Gilgal." 22Samuel said, "Has the LORD as much delight in burnt offerings and sacrifices As in obeying the voice of the LORD?
Behold, to obey is better than sacrifice, And to heed than the fat of rams. 23"For rebellion is as the sin of divination, And insubordination is as iniquity and idolatry. Because you have rejected the word of the LORD, He has also rejected you from being king." Sam 15:22
The man was stoned because he broke the law and there was no atonement for his sin in the OT.
We need to remember that what has been written within the Old Covenant points to the Messiah,such as the Sabbath being a picture of RESTING in Yeshua.
The aforementioned Scripture is not about breaking the law,it looks forward to those not RESTING by faith into Messiah.
Those trusting in their works will be judged because they were not FAITHING into Messiah.
In the book to the Hebrews chapters 3-4 you will find where GOD Almighty talks about resting in Yeshua.
Also ANYTIME a person sins,it is not that they had broken the law,it is because they will not BELIEVE what GOD Almighty says,that is why a law would have been broken,Remember Adam and Eve.