Hey! Sorry if i'm wrong here, but I think that Luna returned to Hogwarts for multiple reasons: - She wasn't safe with her father at her home (she had been kidnapped once before) - Her home was destroyed when Harry, Ron, and Hermione went to get information on the deathly hallows (Her father had contacted the death eaters to take harry in exchange for his daughter's return. I do not remember if her father was killed in this scene or if he somehow managed to escape.) - Luna was safe so long as she was in the room of requirement. There was no need for her to leave that room during her stay at Hogwarts
- She wasn't safe with her father at her home (she had been kidnapped once before)
- Her home was destroyed when Harry, Ron, and Hermione went to get information on the deathly hallows (Her father had contacted the death eaters to take harry in exchange for his daughter's return. I do not remember if her father was killed in this scene or if he somehow managed to escape.)
- Luna was safe so long as she was in the room of requirement. There was no need for her to leave that room during her stay at Hogwarts
I hope this helps :)