In terms of magical brilliance and personal traits, it was Hermione who was the closest to the main hero Harry Potter, and therefore was the most suited to have him as her spouse. A timid Ronald was a world behind the brilliant Hermione and the two hardly had anything in common. So what made Rowling choose Ron over Harry as Hermione's life partner?
It was "wish fulfillment" on J.K. Rowling's part as revealed in an interview for Wonderland magazine.
Excerpts from the British newspaper The Sunday Times:
“I wrote the Hermione/Ron relationship as a form of wish fulfillment,” she says. “That’s how it was conceived, really. For reasons that have very little to do with literature and far more to do with me clinging to the plot as I first imagined it, Hermione ended up with Ron.”
Rowling even realizes that it may not have been her best idea and that some fans did like the pairing.
“I know, I’m sorry,” she continued, “I can hear the rage and fury it might cause some fans, but if I’m absolutely honest, distance has given me perspective on that. It was a choice I made for very personal reasons, not for reasons of credibility. Am I breaking people’s hearts by saying this? I hope not.”
That being said, Harry viewed Hermione as sister not a romantic interest. While speaking to Ron after his return in Deathly Hallows he admits as much:
“She’s like my sister,” he went on. “I love her like a sister and I reckon she feels the same way about me. It’s always been like that, I thought you knew.”