Does your game allow PvP combat actions? If not, loot sharing should be mandatory because it is, inherently, a PvP action. The normal method of resolving such a conflict would be to beat the shit out of the offender until they come around, but if that's not allowed, what in-game resolution is there? As such, an out-of-game resolution is needed, and that is compulsory loot division.
This is why I don't like most dnd dms. Ruling out betrayal because it's 'a coop game' is just as crazy as forcing every session into being a 3 hour combat encounter. If I wanted to play a coop loot dungeon crawler there's about a million video games that automate the dice rolls and loot sharing, lettimg me focus on the action and the loot.
Tabletop's role is to promote emergent story telling, not a more cumbersome way to handle combat and loot. If all a DM can do is stick to their contrived storyline and throw combat at you without facilitating emergent story telling, they're just a worse version of a video game. I'll go play Baldurs Gate instead.
If you introduce backstabbing and betrayal into the game without the other players having previously agreed on it, you're the problem player that tables don't want. If, as a group, you've already agreed to have that kind of game dynamic, then yeah obviously that's fine.
Ironically I'm pretty sure Baldur's gate supports PvP, right down to having the "Dark Urge" character who absolutely would screw with the team by existing.