But no other candidate had a chance of winning the primary, and she only had one real opponent.
That's something for the Democrat Party to deal with. There's nothing "illegitimate" about it.
It doesn't matter if they selected their candidate by rigging the primary system, picking a random name out of the phone book, or flipping a coin.
If anything, the rigging of the Democratic primary shows why an open nomination system may not even be a good thing. Bernie Sanders isn't even a registered Democrat ... so why would anyone expect the Democrat Party leadership NOT to do whatever is necessary to keep him from hijacking their nomination process to get on the Democrat Party ballot line in a presidential election?