Harry Nilsson's version is more popular because it was on the Midnight Cowboy soundtrack and he was huge in the late 60s and early 70s, in no small part due to his association with the Beatles. It's only natural that his version is more well known.
I'm of the opinion that covers are their own special creature and that they can be something close to what the original version was or as far away as possible, but can be something unique and sometimes the cover is simply, for lack of a better term, better. I think the classic example is "Hurt" originally by Nine Inch Nails but the definitive version is from Johnny Cash. Reznor's version does what it does, but Cash's version has so much pain in it, after a lifetime of pain, that even Reznor admitted that the song is no longer his.
I've never seen Midnight Cowboy, but I get your point. Yeah. I'm not a big fan of Harry Nilsson. The only songs I know of his are Everybody's Talkin', and Jump Into the Fire. Jump Into the Fire is my favourite, it's such a bop, and Chris Cornell's cover from his album, No One Sings Like You Anymore, is really good, though, in this case, I prefer the original, and I ended up liking it more because of Goodfellas, which, because it was distorted, in order to represent Henry's paranoia, made it sound like a song by The Cult.
I've tried to listen to the original Hurt, and I can only listen part-way through. For some reason, I can't be arsed. Thinking on it, it's because I share your opinion: I prefer Johnny Cash's rendition, and, again, throwing in, and comparing films, I liked that version more when I heard it on a trailer for Logan, with a tired-sounding James Howlett and Charles Xavier having a conversation.
Oh, yeah, before I wrap this up, Chris Cornell did a really nice cover of Nothing Compares 2 U, which is also featured on No One Sings Like You Anymore.
@cactus I disagree, and I do like both versions, NIN's much less so, but Trent Reznor sounds MORE whiny to me when he starts belting out, "AND YOU CAN HAVE IT ALL..."