You didn't specify a specific work, so let me answer this question from a general literature analysis stand point. Many times in literature, novels and poetry alike, writers use symbols to signify a greater meaning to their work. Fences and walls are a pretty common symbol used to represent separation. A fence can represent a barrier between the characters, both literally, but also emotionally or figuratively. For example, in The Boy in the Striped Pajamas, Bruno and Shmuel's easy friendship is challenged by the presence of the concentration camp fence; at the basic level, the fence represents a challenge that their friendship must overcome, but the fence is also emblematic of the disruptive and evil presence of prejudice and hatred and the greater conflict of World War II and the Holocaust. In The Hunger Games, Katniss sneaks past the electric fence to go hunting to provide for her family; the fence symbolizes the dictatorial control of the Capitol over the lives of the Districts.
When interpreting the fence in your specific piece of literature, ask yourself what else in the story has come between your characters and their objectives or goals.