The reader does not know of the interaction between Wargrave and Armstrong until the end of the book. As we read the book, we believe that each of the characters is murdered by one of the others. After half of the "guests" were dead, Justice Wargrave talked with Dr. Armstrong about a plan he had.
"It was simply this ---I must appear to be the next victim. That would perhaps rattle the murderer ---- at any rate once I was supposed to be dead I could move about the house and spy upon the unknown murderer." (pg 295)
Since Dr. Armstrong was the only person who would be examining Justice Wargrave, it seemed like a good idea. Justice Wargrave could then catch the murderer and all would be solved. Of course, we, the readers, do not know this until the end of the book, so we are equally taken in when we try to figure out the culprit.
This action allows all of the characters to die with no one to blame. Justice Wargrave is the murderer; so pretending to be dead frees him to go about the grounds and kill the others. After Vera, the last one left alive, dies, Justice Wargrave goes into his room to kill himself. Why did he do it? First of all he wanted to commit a murder himself and enjoyed killing since he was young. Secondly, he didn't want to kill anyone innocent. Last, he was dying from an incurable disease and was determined,
".....my death should take place in a blaze of excitement. I would live before I died." (pg 292)
His agreement with Armstrong allowed this to happen.