Well, you have a range of different options.
Change Your Game Metaphor
Does this happen 'all the time' with your group? Not all RPG campaigns are dependent on the "we all work together in a happy little party" model. I always like to bring up Amber Diceless Roleplaying, one of the early games, in which each player being largely opposed to the others was the default metaphor. There are more modern storygames like Fiasco that go this way too, though you can do it in any system really, it's more a way of running a game. If your players chronically don't like the "happy little party" metaphor, don't require it as a part of the campaign setup. Think about all the TV dramas. In how many of them does everyone get along well? Very few.
Solve It In The Game World
Speaking of TV shows with discord in the group - often it is handled by an in-game setup forcing them to cooperate. There's "light forcing," like in Burn Notice, where they main characters are kinda in the same situation and know each other, so there's some friendship bonds etc. in play. Then there's "heavy forcing," like in Walking Dead. It's a zombie apocalypse! Don't like that other guy? Tough titties, unless you think you can go it alone. Or there's stuff like all being part of the military or other non-optional formative unit. "Hey sarge I don't like the way that other guy does stuff!" "HOW ABOUT A NICE HEAPING CUP OF SHUT THE F@#@ UP!" Usually junk like this dissipates if people are properly engaged and challenged in whatever else is going on.
These kind of bonds can be set up a priori by the GM, or they can be created by the characters. Our groups over the last like decade have put some of the responsibility for this on the players in terms of coming up with some starting party metaphor that takes the primary responsibility off the GM to "keep the party together."
Often times disruptiveness is justified by roleplay. But I find that when you press for more immersive roleplay, PCs start to realize that they have bonds with these people... In one long campaign we had a party with a "goody goody" faction and a "getting too into the Cthulhu magic" faction, but they were on an important mission and had to talk it out amongst themselves in game. We all have work groups, gaming groups, etc. with both Christians and pagans, straight and gay, etc... A properly immersive RPG party has both the conflict and the bonds that keep people together despite them.
I strongly believe in trying in-world first, but there is some metagaming stuff to try. Ask the PCs what's up - maybe they don't want a party metaphor at all (see solution 1) but have been in the D&D Ghetto all their life and don't know another option exists. Maybe one (or both) of them likes the character conflict, just sees it as "acting," and doesn't know you're crying in your beer about it.
And of course it's worth having them engaged in trying to "play their characters" in a way that might keep the group more on track. It's very immature to consider that the GM's job and a lot of your stress is coming from the fact you seem to think it is. Just run the game, you're not their mom. Say "I can run a normal party game, or we can try a competitive kind of game, but if we all agree it's a normal party game y'all have to work it out, or kill each other, or whatever your characters would do - but it's not my job to get involved in your beef."
And if course if a character "leaves" - well, have them roll a new character. "I can't deal with these cultists I'm off to purify myself in a monastery!" "OK, great, roll a new character, I'm only really interested in running the group on the main quest in this game..."
Other Stuff To Try
Courtesy your friendly neighborhood RPG.SE.
- Try out game mechanics that encourage team cohesion
one problem player
- Come up with a good mutual starting party