In Harry Potter and the Deathly Hallows the entire house of Slytherin sits out the Battle of Hogwarts. In the book, it's because they all evacuate through a secret passage, like refugees. This is voluntary, as a portion of each of the other houses do stay to fight. Or it could be interpreted that McGonagall evicted them. In the movie, she explicitly orders them all to the dungeon because they're all a bunch of untrustworthy gits. Who's to say one of them won't abracadabra you in the back because he wants to be in Voldemort's good graces?
|They all want that awkward hug|
A lot of readers/viewers say this was unfair and prejudicial. Most of the people in Slytherin we get to see are through the Draco Malfoy eyeglass, who is basically Harry's biggest rival/closest enemy. And anyone associated with him is a Slytherite, so of course they're going to be on the bad side.
But there are either seventy or 250 students in Slytherin (depending on what math you believe). Either way, it's a lot of individuals -- not all of them can be selfish stuck-up gits. Just because you're a Slytherin doesn't necessarily mean you're a bad guy. Merlin, Horace Slughorn, and Snape were in that house and they turned out to be good. Assholes maybe but still on the side of what's right. (And yes, maybe I'm trying to rebut my own placement in this house).
In my head-canon, when the Slytherin students are sent away, they aren't just sitting there, hunkered down in either the pub or the dungeons, listening to the battle like it's the WWII London Bombings.
I like to believe they had their own grand adventure. The untold side-story. Something that influenced the battle like Marty #2 in Back to the Future Part II. Maybe an explosion rocks the cell walls and they're accidentally freed. Maybe a sub-force infiltrates the basement and they're the only ones that can stop them. Their heroics go unsung and unknown (which is double-ironic for Slytherin), but they fight because it's their school too. Just because they're power-hungry doesn't mean they can't use that power to fight for right.
I imagine one of them standing up and rallying the troops. They all feel dejected because of their reputation and the fact that they've been exiled because, through no fault of their own, they've been considered untrustworthy. "We may be douchebags, but we're Dumbledore's douchebags. We all have friends in other houses. If Voldemort wins, a lot of them are going to be hurt. The only people who are safe are those who already have money and power. None of us get easier lives. We're still going to be struggling have-nots. Damon, you came from a trailer park. Reiko, you've still got family on a farm outside Osaka. And if you're not pure-blood, forget it. If we have to be Slytherins, we're going to be Slytherins on our terms."
Or something like that.