Trying to answer the seemingly various questions, not just "why have and what are priests/clerics".
tl:dr There's no should and must when you're designing your own game. Do what sounds fun to you, make something you're passionate about. Sure take ideas or good practice from other games, but unless you're working on someone else's game, there's no need to be a cookie cutter.
From my experience, RPG classes ("hero" or "villain" types) are often divided into four categories: 1. Mage 2. Priest 3. Rogue 4. Warrior
While this is true, it's not an end all be all standard to follow and you're allowed to make your game however you want, there's no rule that says, you need categories X, Y and Z, with classes 1, 2, 3 and sub-classes Alpha, Beta, Omega.
However, there are quite a few popular RPGs that ignore the Priest or Cleric "base" character class entirely. Two game series of note: The Elder Scrolls (Skyrim), and Dragon Age.
That's because some RPGs don't have set class systems. Those single player RPGs tend to offer a range of abilities, skills and other features that allow you to "be the character you want to be". In Skyrim there's not a "Priest or Cleric" but you can most certainly spec into restoration.
Something like a WoW has set classes that you play as because it's a part of the game. You need Tanks, Healers, DPS classes to have an overall successful raid or large scale game-play, but again, this is just a trend, it doesn't mean it's the only way to make an RPG.
Is there a specific reason why this is so? Perhaps the background story makes allowing players to be a Cleric difficult; for example, if there is a large amount of NPCs in the game that have the adventure class of Cleric, and making that class available to players would be detrimental to the story of the game.
It really has nothing to do with backstory and it's more about the freedom to play how you want to play (especially in single player). RPGs are about role playing. Being allowed to be what you want and do what you want is an enormous part of their appeal.
The games like MMORPGs or D&D as was mentioned, have these common classes because they make sense, they're familiar and a bit of a standard.
I've pondered this quandary myself when working on developing my own video RPG; should the character class options be sub-categorized with the aforementioned base classes? Or perhaps even more difficult of a question to answer, should a video RPG include some kind of Deity system?
You can make sub-classes sure, but you don't have to. As I've continued to mention, there's no requirement for what you do in your game. Some trends might be expected, but at the end of the day they aren't required.
In a Medieval RPG someone would expect a sword, or a bow. If you give them a laser gun and say you're a sniper class, that makes no sense. Things should make sense, and those are the types of trends (sensible choices and successful game designs) you should be aiming to follow.
The RPG approach to "gods" is difficult for me, particularly because I've have somewhat of a spiritual perspective on real life, I'm not sure how to reconcile my choices with game design to my choices regarding spirituality.
If it's difficult for you, don't do it. You're allowed to make a game about God classes or Diety characters, but again, if this is your game, you're making the decisions. Go make an RPG about mice fighting back against the Owl overlords if that's what you're passionate about.
If your concern is that a priest is too close to your faith/spirituality, then add healing abilities (if those are needed) to a different character. Name it cleric, wizard, bard, or alchemist or any of the other suggested or common names.
It's so much easier to make something when your heart is in it, "is difficult for me" screams do something else, which isn't a bad thing.