Democrats lost, even when the vast majority of Americans agree with them, because Republicans are a win at any cost (Trumpish) lot. Nobody cares about their junky ideology. They win simply because they focus on gaming the system — blocking Supreme Court nominations, gerrymandering congressional districts, fostering voter suppression laws and jumping in bed with the Russians for help, while of course loudly proclaiming that it is the Democrats who are the cheaters. Trump is the master of this crap and the reason that he is president right now.
Republicans have got such a huge lead in gaming our political system that it is hard to believe that our democracy can be saved. Trump is already putting up Putin and Russia as his ideal model of governance.