Technically, no one actually died, the story is simply a narrative attempting to parallel the story of Achan keeping the spoils of Jericho for himself in the book of Joshua.
And yeah, sure, it was because they lied. Because if they only gave a dollar of the proceeds and kept the rest for themselves, that would have been fine, which was why the author was explicitly paralleling that one other time when someone kept goods for themselves and died for it.
Why can't things change across a narrative.
They do - especially when the narrative is gradually constructed over centuries.
For example, early on in the narrative of Christian canon development you have 1 Cor 9 where Paul is debating with other Christians in Corinth who oppose the notion of people ministering being able to have monetary gain (in keeping with the no purse prohibition and sentiments found elsewhere in extra-canonical sayings attributed to Jesus).
A few decades later you have the Gospel of Mark written which contained a saying attributed to Jesus opposing carrying a purse when ministering with no exceptions.
Later on, this gets copied into Luke and Matthew who use Mark as a source.
Later on, Marcion's version of Luke gets recorded by critics quoting it, so we know that version at that time has absolutely no last supper reversal of carrying a purse. So either Marcion was very selectively removing a ton of nuanced things from across the Epistles and Luke... or things were being added in later on (like when Paul swears to the Holy Spirit he's telling the truth in Romans 9:1, an entire chapter absent from Marcion's version).
Finally, the versions of Luke we have today have a special reversal of not carrying a purse that's more in line with Paul's side of the argument in 1 Cor 9 and the practices of the canonical church over the years after Jesus was dead. A reversal that was absent in the earliest version of Luke recorded.
So yeah, narratives do change. Just like there's a first edition, then a second edition, etc.