Bernie was a popular candidate for sure and it doesn't really take a rocket scientist to understand why people on the left actually like him. Hell, if the 2016 election was Bernie vs Trump, I would have probably expected a win from Bernie. (and I probably wouldn't have been so cocky to put down £50 on him winning that year and getting £250 richer from it either)
The reason they did it was pretty simple. The establishment Dems -HATE- populists like Bernie, though they're not as vocal about him as they are with Trump about it. They know Bernie wouldn't play ball with them and their special interest groups, because of how devoted he is to the idea of socialist reforms. They had to snub him, just so they can wheel in one of their clique to run this time around, which is why they went for someone who's more quasi-sentient tumour than man this year.
It was never about them winning anything in 2020. They're clearly after something else. Weather it's further civil unrest, crippling economical debt or race-relations going down the toilet is anyone's guess. All I'm saying is that the swamp needs to be drained.