Sirius has been thwarted for most of his life. He was accused of a murder he didn't commit and thrown into Azkaban for twelve years. When he finally broke out, he managed to track down the real murderer only to have him slip through Sirius's fingers to rejoin Voldemort. Now, Voldemort has discovered the secret of Sirius's ability to transform into a dog, so Sirius can't even go outside in his "Snuffles" shape. Instead, he is trapped inside his old family home, which is entirely filled with bitter memories of an ugly childhood. And rather than making the best of the situation – he's no longer in prison, he and Harry are forming a strong bond, etc. – Sirius hates where he is and what he is doing, and it clouds his judgment.
In Harry Potter and the Order of the Phoenix, Harry suffers similar feelings, though to a much smaller degree. So in some ways, Sirius's death could be a cautionary tale for Harry to be careful not to get too frustrated and dissatisfied – which sounds like a high price to pay for advice Harry could've gotten from 90% of self-help books out there.