I write from the perspective as one without a PhD, who went through a PhD program, argued with his supervisor about the existence of sentences in the brain, went ABD, my dissertation never examined, and has proceeded to teach, research and write as though he had a PhD anyways (though of course never pretending to actually have one). You can judge from my work whether such an attitude is warranted; I'm content with what you conclude either way.
Certainly, the role of the PhD in practice, from my perspective, means 'stewards of the discipline' in the fullest sense. Sure, there is on the one hand, the desire to maintain the 'vigor, quality, and integrity of the field.' But it seems to me as well that there is a desire to preserve a certain orthodoxy of doctrine, to ensure that a person who professes, say, 'philosophy of mind', professes in that subject as understood by the examiners. Heretics (however defined) need not apply.
But that's the high road. The other aspect of the purpose of a PhD, more cynically expressed, is to serve as a way to short-list applicants for academic positions. After all, position advertisements all specify 'earned PhD required' rather than, say, 'scholars, stewards of the discipline, who will engage in serious research throughout their careers to advance the frontiers of the field and transfer the new knowledge generated through research into applications that enhance human learning and performance,' etc.
An even more cynical view might hold that the purpose of such a program is to raise tuition fees and to always have on hand a stock of cheap teaching labour. Of course, such a purpose should never enter into a formal definition. But one wonders what the enthusiasm of departments to offer PhDs would be were tuitions reduced or eliminated, and were PhD students paid professorial, or near-professorial, wages.
For myself, I found taking the courses and, even more so, completing the comprehensive exams, to be valuable exercises. Though I would say spending the same amount of time engaged in teaching, research and writing would have been valuable in any case. It's hard to say; counterfactuals are like that. The parts involving starvation-level wages and pretending to be a cognitivist I found less valuable.
From my perspective, at this stage of my career, a PhD has no value other than means of getting a job. My cynical self believes that many current PhD students view it in the same way as well, which may explain their placid acceptance of their current experience. And I wonder how many universities view it in the same way.