I dunno... they make it pretty clear in that one Holodeck episode (where a race of like, biological computer people who speak in binary take over the ship by trapping Picard and Riker in the holodeck with a fascinating near-real woman; not to mention the Moriarty episodes) that most of the people produced by the Holodeck are just not real enough. They go through their motions and read their script, but they don't have any real intelligence beyond a small fraction of the computing power of the ship's computer.
So yes, some Holodeck time is probably easier than hiring a prostitute, but most people wouldn't find a Holodeck Husband very satisfactory.
I dunno, I've known people who had over 40 characters in WoW for example, and it didn't bother them all that much to talk to the same NPCs and hear them say the exact same things again, 40 times. Actually, even more, if you count the endgame grind. You could hear the same things and do the same things well over 40 times in a row even with a single character.
Just to make it clear, the NPCs in WoW don't even have the ELIZA class intelligence. They have none at all. They stand in one place, you click on them, they spew the same text. You can't for example try saying the same thing in a different way and see how they react this time, or anything.
Doesn't seem a show stopper to a lot of people.
Sure, some could say, "But Hans, ye berk, they're playing primarily with other people not with NPCs." Well, actually that would be mostly false for some of those, but nevertheless... there's no reason why the same couldn't be done in a holodeck. In fact, it is. Most episodes which feature a holodeck at all, show us more than one person going in at the same time.
Also, well, even a completely brain dead NPC is tolerable _once_ for most people. While the lack of intelligence or of more options may or may not bother you when you replay a computer game, most people don't seem too fussed about it the first time playing through a game. You go get your quest, listen to the NPC spew the scripted text, go talk to another NPC and listen to more scripted text, etc. We can live with that as basically a semi-interactive form of being told a story. You quickly learn to accept that basically you just got to essentially the equivalent of the next page in one of those pick your own adventure books, and it's already written, you just get to read it and make the next choice to get to the next page.
Then once you're done with it, you get the next game, and the whole thing happens once more.
If you think of the holodeck as basically just a standardized game engine, and given millions of people and hundreds of years of creating games and mods and props for that engine, I think it would be perfectly feasible to just play one game after another on it for as long as you live. When you've replayed game 1 often enough that the NPCs get predictable, you just load up game 2, then game 3, then game 4, and so on.
So basically, well, probably you couldn't find the perfect virtual husband in there to last you for a lifetime, but you could have millions of quests and NPCs to keep you entertained in other ways.
And given that last I heard a statistic, IIRC about 2/3 of the online players seem to be women, I'd say they must be easy enough to entertain with something else than a virtual husband.