Let's start from your second question: why is he there? Obviously, to increase the eerie factor and to further convince the audience that Grace and her children have a haunted house problem at hand.
Now, in the context of the movie, which I believe is what you want to know, I don't think it is ever explained how this whole ghost thing works, so I can only offer how I see it.
After the final revelation (that they themselves are actually ghosts) and after Grace tells of her memories of "that day she went mad", this conversation takes place:
Grace: What does all this mean? Where are we?
Bertha: Young Lydia said the very same thing when she realized the three of us were dead. And that was the last time she ever spoke.
The intruders are leaving, but others will come. Now, sometimes we'll sense them. Other times, we won't. But that's the way it's always been.
Nicholas: Mummy, daddy died in the war, didn't he?
Nicholas: Will we ever see him again?
Grace: I don't know.
Anne: If we're dead, where's limbo?
Grace: I don't know if there even is a limbo. I'm no wiser than you are.
This is about all the explanation we get (and, personally, I think it's good that they left it at that). I don't think that even Bertha or her companions know anything more, let alone our newly discovered ghosts. That's the way it's always been, but none of them has any idea how it actually works.
You assume that the ghosts are tied to the place where they died and that they all see each other, but I don't see such an explanation in the movie and I don't think it is correct. The reason is simple: there must have been more people that have died in that house during the course of the centuries and the house would overflowing with ghosts.
It may be that the ghosts are tied to some places important to them. For Grace, who was a housewife, and her children, who she kept isolated in the house, that house was their whole world, so they have nowhere else to be. The husband, however, went to the war, so he travelled far, possibly to several different war fronts, and had some very important things happen to him there (like, for example, dying, but other traumas are quite possible as well). It was important for him to say good bye to his family, so he appeared, but ultimately, some other place drew him.
However, I think that there is also a matter of overlapping. Sometimes we'll sense them [the intruders]. Other times, we won't. It is more than likely that the same thing happens among ghosts. Some of them stick together (like Grace and her children, or like Bertha, Lydia, and Mr. Tuttle), some of them get together (like the two aforementioned groups), and some of them occasionally overlap (like Charles and the rest of his family).
There is no mention if this is random, or an act of some power (possibly God that, in this movie's universe may or may not exist and, if he does, may or may not be anything like any of the major religions believe).
There is also that scene when Grace tries to leave the house grounds, but fails and finds Charles instead. This looks like various groups of ghosts live in their small, separate worlds (the woods around the house being the limits of that of Grace and the other in the house) that sometimes overlap with each other and with our own.
It may even be that the woods is where Charles' world overlaps with the one of the house, but that's just a wild guess. If this is the case, he manages to get to the house with Grace, but is ultimately drawn back to his own world. It is not too wild to think that a spooky forest would also be the limit of the "war front" world (or even every ghost's world).
There is also that conversation between Charles and Grace:
Charles: I just came home to say goodbye to my wife and children.
Grace: Where are you going?
Charles: To the front.
Grace: I thought the war was over.
Charles: The war is not over.
This leads me to believe that in his world (if we accept that theory), the war still rages on. That can also explain what is more important to him than returning to his family.
I repeat: all of these are just my interpretations, as I have found no canon explanations.