A valid question I feel, as I too was somewhat confused. It seems this movie had the potential to be a lot better (scarier) but something was compromised along the way.
I was under the impression that there were a number of ghosts rampaging through the trenches, especially after the scene with the three germans in barbed wire standing at the end of one trenches. Then confusion reigned when the trench itself seemed to come to life.
In the end I think that the trench represented hell and the british soldiers, already dead were just fighting for spiritual redemption of some kind. The only one who escaped this never ending hell on earth was the Jamie Bell character who, in the face of uncompromising death ,destruction and hatred was the only one who showed any real act of kindness or humanity.
I was unsure if the group who stumbled upon the trench at the end where the same soldiers as at the start, but I don't think it mattered that much. By then the plot had already been lost in a sea of blood drenched mud.