I don't know if this has been theorized before, but I was re watching Season 2. In the finale Libby tells Desmond that her husband's name is "David," the one who had the boat, etc. She also goes on to say that he "got sick" which, as the series LOST has proven plenty before, sometimes when someone "gets sick" in the show it means they "went crazy." I.e. the "sickness" as it pertains to Danielle and later Sayid and Claire. Imagine if Dave, Hurley's "imaginary friend" Dave, was really the ghost of Libby's ex-husband "David," who went crazy (got sick) and died during his stay at Santa Rosa. We can guess that maybe her husband going crazy and dying while in Santa Rosa made Libby go crazy and end up there too.
This is why she's so fond of Hurley. She remembers him from Santa Rosa as the guy who talked to "Dave," someone who wasn't really there, in the building where her husband Dave died, not knowing Hurley really can talk to dead people. She probably paid close attention to him while she could and realized that she could perfectly imagine her husband Dave as if he were talking to Hurley, which could be the case.
Adding to this, LOST is always big on irony. If Libby and Dave were really married like I thought, how ironic is it that Dave was trying to talk Hurley into jumping off the cliff while it was Libby who talked him out of it?
I don't know, I was just watching this and got to thinking haha. I don't know if it's too far fetched or if it's been brought up a hundred times. But that's my take on it.