Earlier quoted context omitted.
Political parties aren’t democratic institutions. They are essentially private organizations who can operate however they want. It’s only been the last 50 years or so that either party has used primaries as anything more than a straw poll
The DNC and RNC are legally bound to follow rules established both by state law and by Congress/legislation. Yes they are private institutions but they can not set arbitrary rules.
They aren't even obligated to donors who donated under the assumption that there's some promise or legal requirement that their primaries be fair. That case was dismissed, and resulted in the quote from DNC lawyer Bruce Spiva:
"You know, again, if you had a charity where somebody said, Hey, I’m gonna take this money and use it for a specific purpose, X, and they pocketed it and stole the money, of course that’s different. But here, where you have a party that’s saying, We’re gonna, you know, choose our standard bearer, and we’re gonna follow these general rules of the road, which we are voluntarily deciding, we could have — and we could have voluntarily decided that, Look, we’re gonna go into back rooms like they used to and smoke cigars and pick the candidate that way. That’s not the way it was done. But they could have. And that would have also been their right, and it would drag the Court well into party politics, internal party politics to answer those questions."