I think you're all missing the bigger picture. Yes, it's pretty likely that enforcing party discipline the way Republicans did will cost us seats in the short term, but guess what, Republicans did that, and now they hold majorities in both houses and do basically what they want with it. In the short term, they sacrificed seats they could have easily kept (Chafee, Jeffords, Specter, Castle etc.), but in the long term, this created a chilling effect for current Republicans in Congress, who are terrified of breaking from the party line in any circumstance. And sure, this cost them the Senate in the short term, but eventually you get a wave big enough to regain control. Democrats need to start playing the long game.
Yes, the rise of Trump made that abundantly clear.
Would you like to go down the route of "party before country" as well? Because insisting ideological purity has the counterproductive effect of not actually producing ideological purity but instead generating a cycle of increasingly bellicose and strident behavior that emphasizes rhetorical tone over policy substance.
You see the Republicans in power and think that ideological purity has served them well, not realizing that such power has come at a great cost. Far from being ideological pure, they've been overtaken by a man who possesses none of their ideological trappings, only their belligerency and opportunism. Their soul has become rotten to the core. Is that what you want for the Democrats as well? Power without integrity? Power simply for the sake of power?