Hermione was shocked into speechlessness and not by Harry alone. She had been wondering to herself about the same thing. Why was Harry helping Draco. They have enough rivalry and hatred between them, so why this sudden change of heart. But as she heard Luna talk to Harry, she noticed how astute her observations were. Hermione knew Harry was suffering from guilt for not trusting Snape was an ally. That was why he installed Snape’s portrait at Grimmauld Place. So it did make sense that he was helping Malfoy in Dumbledore’s memory. In his own way he was trying to show that he trusted Dumbledore’s judgement.