In the Fate universe, is there a reason why the Servants summoned in each Holy Grail War belong to different classes?
Using relics and additional incantations during the summoning ritual, Masters have some degree of control over the Class (e.g. Matou Kariya's additional incantations to choose the Berserker Class) and exact identity of the Servant.
What would happen if two Masters both tried the same Class using an incantation (e.g., Berserker), or even used (part of) the same relic to summon the same Servant? For example:
What would happen if Waver Velvet had only stolen part of Rider's (Iskandar) cloak, unbeknownst to Kayneth Archibald, and both Masters tried to summon Rider?
Using relics and additional incantations during the summoning ritual,
Masters have some degree of control over the Class
The keyword here is "some". The Servants are summoned by the Grail, even though the Masters have some sort of control of what they are trying to summon. This wiki states (it has a reference too, but the reference is in Japanese):
The Three Knight classes are the only Servants who will definitely be
summoned according to the framework of the Holy Grail War, allowing
for variation in the rest of the classes. More than one version of the
same class cannot be summoned, even if all the Masters were to use the
variation in the summoning chant to get a Berserker-class Servant.
So apparently in this case, the Grail will summon a Servant based on it's compatibility with the concrete Master, much as it has happened with
Whoever summoned a class first will get it for certain. If two Masters tried to get Saber, whoever summoned it first would get it and the other would get the hero their catalyst would summon in another role. To give an in-universe example: Gilles de Rail (Caster) was summoned as his weakest possible class in his weakest state: after the death of Jeanne D´arc where he was a deranged serial killer who delved into magic. Had Ryounosuke summoned Gilles earlier, he would´ve most likely gotten him as a Saber or Rider, the two classes he belongs to the best.
There´s never really a reason given as to why classes exist. The best answer I can give you is variety in combatants. If all 7 masters summoned a Hassan Sabbah (Assassin), the show would honestly suck.
The Servant System is a ritual with the purpose of summonning 7 Grand Servants in order to protect mankind from being wiped out, these are the 7 greatest heroes belonging into each of the classes and they are summoned in their strongest form, in their prime, as recorded in the Throne of Heroes. This is a ritual done by the collective unconciousness of humanity, Alaya, and draws power from the Root itself, beyond human comprehension. Then the Makiri (Matou) family designed the Servant summoning ritual for their Holy Grail War in imitation of this Grand Servant ritual, but the summoned Heroic Spirits are sort of shackled by the Classes in which they are materialized, so they are not the full forms of the Servants. For example, Artoria when summoned to the Saber class has no access to her Holy Lance Rhongomyniad, and if she's summoned as Lancer she doesn't have Excalibur. So the Class restrictions as are seen in Fate/stay night are completely due to it being an imitation of another higher ritual.
On the other hand there are instances of 2 Servants of the same class being summoned. In the 3rd HGW, The Edelfelt sisters summoned 2 aspects of a single Saber Servant, so there were 2 Sabers during that war, but it had more to do with their family Magic Trait, Ore Scales, so it was a very unusual situation.