Baron, The counselor thing has been mentioned. In today's world, there's overlap between the roles of a priest and a counselor, but they are not identical. We have both in the real military, and I see no reason not to have both in Starfleet, especially in the original series era, when counselor was not a specific position on a ship, and ships did have chapels. Also back to today, a military chaplain has to be available for anyone of any faith, regardless of his own. At one time, there was even a wiccan RP (a chaplain's enlisted assistant in the navy - Religious Programs specialist). In Starfleet, due to the number of species, I'd expect that there'd be groupings of different races in integrated crews, partly to keep life support needs simpler, and to avoid excessive crew disharmony from cultural differences. That'd reduce the field of religions a given chaplain would have to know in-depth in order to minister to his fellow crew ("shipmate" is a derogatory word today. Too many sailors use it to mean "shitbag I outrank and intend to publicly humiliate", not "fellow sailor", as intended).
So, in-story and from a writer's external perspective, how should a chaplain be integrated into a series, and what stories should revolve around such a character?
S/he can be a good person or bad, depending on the writer's needs. In-story, as an organization, you'd want
chaplains who help the crew with their spiritual needs, not ones who put their doctrine ahead of their duty to their crew, but won't always get that. Meta-story, a chaplain can highlight the diverse spirituality of the crew, provide a philosophical counterpoint to a storyline, and be an emotional anchorpoint (kind of like McCoy's role for Kirk, but for the whole crew), or can be an example of religion gone bad (Adm Satie, Stiles from Balance of Terror), of fallible people trying to do good but not always managing to get past their own prejudices, or whatever negative role pushes the story. A chaplain can smooth spiritual antagonisms in a way counselors can't manage as effectively, or can fan the flames of such a character conflict.