Consider this passage from Chapter 31, “The Lost Prophecy” of Order of the Phoenix:
“More recently,” said Dumbledore, “I became concerned that Voldemort might realize that this connection between you exists. Sure enough, there came a time when you entered so far into his mind and thoughts that he sensed your presence. I am speaking, of course, of the night when you witnessed the attack on Mr. Weasley.”
“Yeah, Snape told me,” Harry muttered.
“Professor Snape, Harry,” Dumbledore corrected him quietly. “But did you not wonder why it was not I who explained this to you? Why I did not teach you Occlumency? Why I had not so much as looked at you for months?”
Harry looked up. He could see now that Dumbledore looked sad and tired.
“Yeah,” Harry mumbled. “Yeah, I wondered.”
“You see,” continued Dumbledore heavily, “I believed it could not be long before Voldemort attempted to force his way into your mind, to manipulate and misdirect your thoughts, and I was not eager to give him more incentives to do so. I was sure that if he realized that our relationship was — or had ever been — closer than that of headmaster and pupil, he would seize his chance to use you as a means to spy on me. I feared the uses to which he would put you, the possibility that he might try and possess you. Harry, I believe I was right to think that Voldemort would have made use of you in such a way. On those rare occasions when we had close contact, I thought I saw a shadow of him stir behind your eyes. … I was trying, in distancing myself from you, to protect you. An old man’s mistake …”
Dumbledore was intentionally being cool toward Harry for the entire book, because he was worried that if Voldemort learned of their relationship (which was much closer than that of a typical headmaster and pupil) then Dumbledore and Harry would be endangered. If Dumbledore had walked into Harry’s hearing and spun some yarn about how he had given Harry permission to do magic outside of school, however, it would have been obvious to everyone that their relationship was unusual.
And that’s if he hadn’t been caught in the lie—if he had, the fact that he perjured himself to protect Harry would have indicated an even more unusual relationship! (I think the other answers have already addressed the logistical problems of Dumbledore lying.) During the hearing, Dumbledore intentionally threw Harry under the bus because he judged that Harry’s potential punishment would still be less damaging than revealing their relationship to Voldemort.