One thing that several of the writeups here have alluded to is the fact that Dick's sanity was, at best, shaky. He himself was well aware of this, and in several of his essays and letters, makes allusions to the idea that he was a high-functioning schizophrenic. There's a fair amount of evidence that would seem to back this theory up; indubitably, the VALIS trilogy was written in the aftermath of a several-years long psychotic break, apparently triggered by unhealthy living, megadoses of vitamins (as was fashionable in the 70s), and a bad reaction to anesthesia during dental surgery. The (probably quite mad) character Horselover Fat in VALIS is an actual representation of Dick himself, of course, and the Exegesis that is quoted in the book actually exists, written by Dick during his break.

Looking further, the virtual obsession with the mutable nature of reality, the claustrophobic paranoia, the fixation on others masquerading as human, the recurring themes of the Apocalypse and communication with God, are all fairly typical of the ideas which crop up commonly in the mind of a paranoid schizophrenic.

Of course, the waters are a bit cloudier than this. Dick did a lot of drugs during his life, and they can provide the same kind of harsh illumination as organic madness. Also, if he was paranoid, he had reason to be. The government really was out to get him, at least for a long while. He was kicked out of Berkeley for refusing to participate in ROTC, and was a known associate of all sorts of dissidents, which was more than enough to put him on the FBI's domestic surveillance list for a long period of time; people would break into his house, ransack his files, pick him up for interrogation. All this would make quite an impression on a literarilly inclined youngster.

Even if Dick was, in some sense of the word, insane, I don't believe that that really serves to detract from the value of his work, which is, in any case, pretty fuckin' far out. What the work of Phillip K. Dick, especially his later works, serves as, is a perfect picture of a certain state of mind, filtered through the prism of his undeniable genius.