You are adding to the text. It doesn't give a reason why he was gathering wood, which means the reason is irrelevant. It is far more likely that he was gathering wood to make a fire. But again, it doesn't really say. Here is a discussion of the possible reasons that gathering wood was a violation of the Shabbat: https://www.thetorah.com/article/what-melacha-did-the-wood-gatherer-violate
So his picking up wood didn't break the sabbath but his intending to use them for a fire did? In other words he was killed before he actually lit the fire! I don't think that's what happened.
Since the text just says he was arrested when he was found collecting wood, then it's far far more likely that he was guilty of working, (i.e., engaging in a money making activity).
The Biblical definition of "profaning the Sabbath" is to engage in a money making activity. That is proven in Nehemiah 13:15-18, where Nehemiah witnesses winemakers and food merchants going about their business, and asks them “What is this evil thing that you are doing, by profaning the Sabbath day?
That is also proven in Amos 8:5 where the wicked are addressed as a people who ask “When will the Sabbath end, that we may offer wheat for sale?", i.e., they were waiting for the Sabbath to end so they could go back to earning money by selling wheat.