This question has been asked and answered many times right here on eNotes. Here is a link for you: http://www.enotes.com/interlopers/q-and-a/tags/setting
I think part of the way in which the bleak, dark and dangerous setting of the woods function in this tremendous story is that it echoes the feelings and passions of hatred and violence that occur in each of the main protagonists. We are told that the action occurs during a "wind-scourged winter night," and there are many signs of agitation in nature and premonitions of bad events to come:
The roebuck, which usually kept in the sheltered hollows during a storm wind, were running like driven things tonight, and there was movement and unrest among the creatures that were wont to sleep through the dark hours. Assuredly there was a disturbing element in the forest, and Ulrich could guess the quarter from whence it came.
The setting then seems to echo the hatred and violence in Ulrich and Georg's own being, as the "whistling and skirling" wind and the "restless beating of the branches" parallels the turmoil of emotions in both of the protagonists. Note the way that the falling of a tree is referred to as "a deed of Nature's own violence" that again seems to act as almost a pathetic fallacy, reflecting the violence that each of the characters would do to the other.