It has been awhile since I've read Harry Potter and the Order of the Phoenix, but just from reading the selected passage, it's clear that Harry has lied to the 'she' in question (probably Hermione) about hiding from everyone since he got back from St Mungo's, and this 'she' knows this because Ron and Ginny told her that.
We know that Harry is quite angry at being 'betrayed' perhaps, because he glares at Ron and Ginny. He goes on to ask 'They do, do they?' Now onto your question:
Why has J. K. Rowling used a palindromic 'They do, do they?' instead of just a 'Do they?' in this passage?
In writing, when authors try to convey a character's emotions (say, annoyance) using certain literary devices like sarcasm, it is not uncommon to make use of question tags in dialogue to provide emphasis on what is being said, and to make clear that such a device is being used.
In this case, like I said, Harry appears to be upset with Ron and Ginny, for divulging his secrets, or at least sharing some confirming evidence that rebuts his denials, and he makes use of a question tag. Harry is upset here, not confused. He doesn't want to know whether Ron and Ginny have told 'her' that he's been hiding, i.e. he doesn't expect an answer. He (and in turn, the author) wants to convey that he's annoyed and upset with Ron and Ginny for telling 'her' that he's been hiding with a rhetorical question. We can also ascertain this, again, from the use of the word 'glaring, which means 'staring in an angry or fierce way.'
Of course, the job could have been done with a plain 'do they?' if you can imagine the appropriate intonation for such a question, but as @virolino has said, the beauty of the symmetry would be lost. Also, I think the additional question tag adds an extra layer of frustration and sarcasm.
Hope this helps. Enjoy reading!