The setup of the story seems to lead us to predict that something bad will happen to Tom and his wife. The treasure is clearly established as being associated with the Devil, and that the time period in which the story takes place was occasioned by many earthquakes, which at the time were often taken as religious signs of unrest. The fact that the treasure is introduced at all will lead us to expect that someone is going to find it, and receive the mixed blessing of its wealth and its negative associations.
When we are introduced to Tom and his wife, they appear as one-dimensional and petty people who are ruled by basic vices and feelings. An insightful reader might predict that they are doomed to encounter the treasure and have their lives changed by it, and the fact that this is how the story plays out may make it less than satisfying, since the characters are simply meeting our expectations at almost every turn. On the other hand, seeing blatant evil being blatantly punished gives the story an arc and may explain why so many other fables have a similar structure.
There are at least two reasons for Tom's wife being dismembered (he finds only her heart and liver tied up in an apron). One is to demonstrate the Devil's destructive power, which until that point had only been implied. The other is that his wife directly picked a fight with the Devil, as evidenced by tufts of black hair on the ground; it seems that she thought she could fight with the Devil just as she did with her husband. Another reason may be that she was simply less important to the story, and killing her allowed both the Devil and Tom to be further characterized by her death, as well as eliminating her from the story to allow Tom further freedom of action.