First, it should be noted that this story is an allegory meant to represent a larger or morally significant idea. The moral in this story is that of greed and the negative consequences of it. What happens to Tom Walker is symbolic of what can happen to any human consumed by greed - he/she will lose their soul to the obsession.
More specifically, the woods in this story are a symbol of Tom and his conscience. The woods are dark and hard to navigate. It would be easy to get lost in them. Similarly, Tom's conscience is dark and muddled. He easily gets lost in it, lost in the greed for money and power, and this makes him susceptible to "getting lost". He loses to the power of the devil.