JKR explained prior to the release of Half-Blood Prince that she didn't intend for Neville and Luna to end up together because she saw them as too different to be compatible:
- "The Luna/Neville shippers are much less vehement and scary than the Harry/Hermione, Ron/Hermione tribes, so I hope I won’t receive too much hate mail for quashing this rumour. I see Neville and Luna as very different kinds of people and while they share a certain isolation within Hogwarts, I don’t think that’s enough to foster true love - friendship, perhaps, although I think that Neville would always find Luna’s wilder flights of fancy alarming."
However, when she was writing Deathly Hallows, she began to think that a relationship between the two might actually work out:
- "Ummmm ... sometimes characters misbehave a little bit, and want to do their own thing. But I think I know them very very well, so they've never really taken me by surprise. Except -- I can say this because it hasn't happened but there is speculation at one point on the internet that Neville and Luna would end up together (audience giggles). And I said, "No, that won't happen." But you know what, while writing Seven, I started to feel a bit of a pull between Luna and Neville in a way. I started to see how that could work, but it hasn't happened. That was an interesting thing. The moment I'd said, "Of course, they would never fancy each other," I go... I don't know... You know, I kind of see that."
However, J.K. Rowling ultimately decided to leave Neville and Luna's relationship "open" at the end of the last book, because putting them together “felt too neat" to her. Out of Harry's circle of friends, she paired off Harry and Ginny and Hermione and Ron, so I guess she thought pairing off Luna and Neville would've been too perfect.