You cannot have a football game between the Cowboys and the Redskins and then suddenly, a San Francisco 49-er runs onto the line of scrimmage and says that he's playing on the Redskins team.
Bernie refused to join the Democratic Party, and that means that he is not a Democrat, even if he says he is running "as a Democrat".
Because according to the rules of both parties, "running as a Democrat" (or as a Republican) might more accurately be:
"Running as if I was a Democrat".

There simply are no party provisions for people running "as if" they were a member, you have to BE a member of the party.
And so, because Bernie was NOT a member of the party, the party chose someone else. I'm fairly certain that, if it had been anyone else instead of Hillary, they would have done much the same thing, namely: PROTECT THE DEMOCRATIC CANDIDATE.

Because in the end, whether you and I agree what they did was immoral or even sometimes illegal, they did what a party is required to do, select a candidate and then protect them.

Right now as you read this, the South Carolina GOP is pondering the idea of canceling their 2020 GOP SC state primary ALTOGETHER, in order to protect Trump.

That means, if enough states cancel their GOP primaries altogether in 2020, NO ONE "running as if they are Republican" has a chance because no other REPUBLICAN PARTY MEMBER even has a chance.

When seen through that kind of lens, all of a sudden the DNC closing ranks around Hillary in 2016 seems rather tame by comparison.
Bernie, as much as I love the guy, should have tossed his silly and sentimental "Democratic Socialist" tag in the trash the day he set foot on Capitol Hill for the first time, because in reality, according to the work he has done, he's a liberal New Deal Democrat in the style (and largely platform) of FDR.

Had he done that all those years ago, I suspect that the DNC would have been transformed by him* a long time ago, and they would have had no choice but to run him in 2016.

(*Witness his considerable grass roots 2016 crowdfunding mojo - now extrapolate that out ten years prior all the way up till 2016)
"The Best of the Leon Russell Festivals" DVD