They knew that one who profanes the Shabbos is put to death. They were just unclear as to the nature and procedure of the execution. In an alternative exposition, the commentators state that actually they were well aware of the type of execution which is meted out to a mechallel Shabbos, one who desecrates Shabbos. Nonetheless, they were uncertain as to what to do with the mekoshesh eitzim, the man who gathered wood on Shabbos. Why? It seems that the mekoshesh’s intentions were noble. He wanted the people to realize the seriousness of Shabbos desecration. They should know that one who desecrates Shabbos is put to death.
We now understand their overriding concern about executing a fellow Jew who got carried away with his zeal for conveying the critical nature of Shabbos. Perhaps such a Jew should not be executed. After all, he acted l’shem Shomayim, for the sake of Heaven. He was willing to make the ultimate sacrifice to impart a message concerning the sanctity of Shabbos. Should we not be lenient with such a person?
There is a flipside to this argument, one that is becoming more compelling, as we see people of all ilk resonating to this form of excuse for committing every type of sin and immorality. “It is l’shem Shomayim” has become a rationale to justify the most deplorable activities. “How else can we reach out to them?” “If we do not get into the mud with them, they will never give us the time of day” and other such excuses. L’Shem Shomayim is not an excuse for transgressing the Torah.