Obama did everything you are claiming it was nigh impossible for Bernie to do, with far fewer years in the political arena. Stop excusing Sanders for his failures.
Because Obama was a great orator who could draw people in with his speeches, was black to draw in the socially and racially conscious folk against the racists on the right(and in the clinton camp if we recall), had a good sellable backstory and generally speaking was not opposed to corporate interests when he was campaigning, which fit as a good opposition to the old guard in Bush. Those are reasons me and my family voted for him(also there's the whole thinking he was progressive, but that changed eventually)
It didn't help that Clinton ended up being sleaze when she tried to imply that staying in till the convention was good because *some generic allegory to Obama being assassinated like Kennedy would lead to her possibly being able to come back*
https://www.youtube.com/watch?v=04F4hIthQbU
And on top of that, Obama never went easy on Clinton the way Sanders did. He destroyed her for her historical accounts during those debates whereas Sanders only implied that money and influence corrupted politicians, and only ever brought up Goldman sachs at absolute worst. He even dismissed the email shit that he could have used despite it being nothing but fake news.
Obama would go for the jugular on a consistent basis, but today's environment, the media would have framed Sanders as a sexist who blamed "the elites" and "big business" unfairly, even more than they already did . It didn't hurt that this was a time when establishment media was also not so concentrated on the bidding of capital. And so we would get stories like this, on a fairly consistent basis during the campaign.
https://www.youtube.com/watch?v=yuZhwV24PmM
If the media had done the same thing to Clinton during this election that they did last election(hell they could have used the same stories), i have no doubt the numbers would have been even closer, possibly even able to make up the difference in name recognition. Sanders being against corporate interests this time allows them to frame the terms as Sanders being a socialist far lefty where as Clinton is the reasonable one with "ties to influential partners" just boosting her appeal.