In Books 1 through 4, Professor Dumbledore has been like a grandfather figure to Harry. Twinkly-eyed and (apparently) all-knowing, Dumbledore has always been someone for Harry to trust. Dumbledore has become a cornerstone of Harry's life: he has seemed almost invincible.
But now, as Harry is getting older, his relationship with Dumbledore is changing. Dumbledore is the head of the war effort against Voldemort, and as Harry's role in that war grows more ambiguous – and as his link to Voldemort grows more dangerous – Harry doubts Dumbledore more and more throughout Book 5. Since Book 5 is a turning point when Harry starts to stand on his own two feet, his relationship with Dumbledore has to change. Still, it's an awkward and horribly painful process to read.
At first, Harry's failing faith in Dumbledore seems like the same kind of resentment he turns on Ron, Hermione, and all of his friends. Harry is angry that Dumbledore chooses not to fill him in on the activities of either the Death Eaters or the Order of the Phoenix, when Harry has faced down Death Eaters every year since he started school at Hogwarts. Harry resents being left out of the loop, and he blames Dumbledore for isolating him further.
Things grow more complicated as Harry notices that Dumbledore is actively ignoring him. During Harry's (extremely stressful) hearing at the Ministry of Magic for the underaged use of magic, Dumbledore offers his testimony about the dementors in Little Whinging without ever once looking at Harry. In fact, as Harry is cleared of all charges, Dumbledore says only, "Excellent [...] Well, I must be getting along. Good day to you all" (8.155). Harry feels disappointed and abandoned when Dumbledore doesn't stop to speak to him.
Even the Order of the Phoenix members notice that Dumbledore's behavior towards Harry has grown odd. Kingsley Shacklebolt, the Auror, wonders aloud, "why Dumbledore didn't make Potter a prefect? [...] But it would've shown confidence in him" (9.240-242). Harry also can't understand why Dumbledore suddenly appears to prefer Ron to Harry. Harry feels neglected, so he decides not to confide in Dumbledore.
As Harry's nightmares grow worse and he feels more pressing pains in his scar, both Ron and Hermione insist that he go to Dumbledore. But Harry still feels abandoned by Dumbledore, so he turns to Sirius instead. Harry's growing relationship with Sirius, who Harry is "coming to regard [...] as a mixture of father and brother" (37.105) is in part the result of Dumbledore's own increasing distance from Harry.
Dumbledore appears less in the pages of Book 5 than he has in any of the previous books, in part because he and Harry are avoiding each other so much. So, when they do see each other at close quarters in Chapter 22, it suddenly seems incredibly tense. Harry describes the snake attack on Mr. Weasley that he saw in his vision and Dumbledore starts investigating without once explaining to Harry what he suspects. Then Harry looks at Dumbledore:
Harry's scar burned white-hot, as though the old wound had burst open again – and unbidden, unwanted, but terrifyingly strong, there rose within harry a hatred so powerful he felt, for that instant, he would like nothing better than to strike. (22.81)
This sudden feeling of strange, alien hatred seems only an intense version of Harry's own ongoing, simmering rage at Dumbledore. Harry's anger at Dumbledore leaves him all the more vulnerable to Voldemort. And when Dumbledore is finally banished from the school by Minister Fudge and Professor Umbridge, Dumbledore disappears entirely from Book 5 until he appears in the Department of Mysteries to confront Voldemort.
By the end of the novel, after the showdown at the Department of Mysteries and Sirius's death, Dumbledore explains all: he has left Harry in the care of the abusive Dursleys because Petunia Dursley's blood relationship to Lily Potter could keep Harry safer than any other magical protection. He has grown afraid of Harry's connection to Voldemort. Perhaps Voldemort, knowing Dumbledore's love for Harry, would possess Harry and provoke Dumbledore to kill him. So, Dumbledore attempted to avoid Harry throughout Book 5 for Harry's own good.
Dumbledore has known all along that Harry is connected to Voldemort, and that he has been prophesied to be the one to stop the Dark Lord. Either Harry or Voldemort has to kill the other in the end, according to this prophecy. But Dumbledore has never told Harry these details because he didn't want to burden Harry too much. In fact, Dumbledore chose not to make Harry a prefect because, "I must confess ... that I rather thought ... you had enough responsibility to be going on with" (37.218).
Dumbledore's great mistake in Book 5 is that he's so attached to the idea that Harry is a child to be protected that he deprives Harry of key pieces of information that might have changed the outcome of the novel:
Dumbledore leaves Harry alone during one of the worst years of his life, making Harry all the more vulnerable to the bad feeling and suspicion that leaves his mind open to Voldemort.
However, we have some sympathy for Dumbledore. Harry spends Book 5 being grumpy to prove that he is above all human and feeling (unlike Voldemort). Similarly, Dumbledore, who has spent the previous four books as Harry's idol, has to come down off of his pedestal. He must begin to appear human to Harry as Harry grows up. And the mistakes he makes in Book 5 – most of them out of love for Harry and concern for Sirius – lead to disastrous consequences. But above all, Dumbledore shows us that he is a man capable of making errors. He's not just a white-bearded wizard; he's also a human being. We can't help but feel for Dumbledore all the more as a result.