Harry sees a vision of Voldemort tormenting Sirius in the Dept. of Mysteries. This leads him to rush off to try and save him, and when his friends are unable to dissuade him from going, they insist on going too.
If Harry's vision was correct, he would have ended up confronting Voldemort in the Mysteries chamber. Did he really think he had a chance of A) not dying and B) saving Sirius and escaping? Understandably, Harry was in extreme emotional distress seeing Sirius, his only living family and father figure, being tortured and likely killed. His reaction pure dumb bravery, like jumping in front of train to save someone you love who is on the tracks. Why wouldn't one of his close friends, especially someone as smart as Hermione, point out that even as a group they almost certainly would all be killed by Voldemort, doing Sirius no good and causing the very last thing Sirius would want?
I've always thought of this as a plot weakness, and that Voldemort could have used a much more clever pretense to lure Harry there.