Many versions put this in a more logical order such as "count the money and put it in bags."
Possible meanings are 1) "put the money in bags" or 2) "tied up the money in bags" .
"the money that they found in the chest"