You need to remember that this story is allegorical by nature which means that it works on two levels and has a clear message. The characters and events of allegories such as this tale can be understood both for what they are (a literal interpretation) as well as for the abstract principles they represent (a more symbolic interpretation). Thus what you need to do as you read the tale is consider how the characters work symbolically - what they might represent.
So, to return to your question, you could say that both options are completely correct. It is clear that the tale refers to the Devil as creating a "tussle" between himself and Pahom that results in his demise, but equally, reading the character of the Devil more allegorically, you could argue that he represents human weakness and greed and man's insatiable desire to have more and his inability to never be satisfied. Both explanations are valid for this allegory, but to pick one ignores the depth and richness of the point Tolstoy is trying to make. You might want to go back now and consider what other characters, events and locations might represent in this tale.