I think this idea makes a great deal of sense. Think of some of the anomalies the characters run into -- being turned into children, meeting creatures that proclaim to be gods or take on the form of religious figures, fun with DNA, and space being the great unknown. While the officers on duty some of this has got to screw with their minds and get them thinking about spiritual matters.
I guess that a Starfleet Chaplain would be like a counselor that specializes in existenial questions that can't be answered; as opposed to a counselor, who helps you work through emotional trauma/conflicts/depression. A counselor could work you through these problems as well, of course, but splitting the position might be useful -- one to keep the crew's mental/emotional health in check, one to help with those bigger un-answerable questions.
I also don't have a problem believing that a Starfleet Chaplain could be well-versed in hundreds of different religions and philosophiess. I mean, I already accept that Starfleet has these wonder-engineers that can squint at a screen of data and come up with new techniques never before attempted that work perfectly. It would be like the potential career path for those religious studies and philosophy majors in the Trek universe.
Even if the humans in Trek have moved beyond religion, and are 'evolved' humans, they've still got to have some of the kinds of questions that keep you up at night. Trek is always trumpeting what it means to be human, and i think that's a part of it too.