For a start we seldom talk about men, and men probably use sex workers of either gender more often than women do. Indeed when articles on the internet talk about the users of sex workers services, they exclusively refer to men.
If men are hiring prostitutes, and using them for sex rather than merely talking to them, I think it's primarily for human contact.
We are primates after all, animals that spend hours grooming all members of their group.
In our society touching is nearly forbidden. We spent the first 9 months of our lives completely encased in human contact. While women can hug and touch their friends, men cannot ask for affection in our society. However it is completely okay for men to ask for and have sex. And the only other socially acceptable way for men to have human contact is via handshake and physical violence. All of limited social acceptability.
If men hug each other it is usually done while hitting the other male on the back and then it's usually only between close male relatives, like father and son, who have a good relationship.
In my opinion, men generally use sex as a substitute for affection. Sex is macho, affection is wussy.
And as such, sex therapists, marriage counselors use the frequency of sex in a marriage as a barometer for how healthy that marriage is. That's great if the sex isn't excruciatingly painful for the woman; or, the man or his partner (male or female) doesn't place undue pressure on him to perform. Nevertheless, I suspect affection would provide many of the benefits that sex supposedly delivers without the need for often invasive contraception or the risk of unwanted pregnancy. But I think the therapists who recommend sex are thinking about his ego when they advocate sex improving self image because it would definitely not be macho to say they engage in frequent cuddling, for instance.
The usual way for men to get regular sex (affection) is having a partner. But maintaining a relationship can be difficult for some men. Either they aren't emotionally/financially ready, or equipped for a partner's needs. So prostitutes may fill that need as well. The other need that prostitutes might help satisfy is loneliness. The need for intimate/personal conversations to have conversations with someone who isn't a man. When I used to talk to clients (all men) I used to have a stockpile of topics I could discuss with them and it would involve sports and cars, these topics were extremely abstract.
Loneliness and our need to touch and be touched are what, I think, drives prostitution. But what about hormones? Yes, sex is really for procreation and our bodies are driven to procreate because of hormones. But do we really want to risk unwanted pregnancy and STDs just so one gender can relieve their hormones that could be easily relieved with masturbation?
I assumed when I was asked to write on prostitution why women took on a profession that would make them reviled. Everyone needs money in our society. Not all women have someone who can support them and men always seem to want sex - goddess knows how many times I've been asked if I was working while wearing sweats, exercising, just walking down a street or waiting for my husband...
But the problem here is the macho. Men pretending or completely unaware they are pretending to be impervious to needing anything. Needing makes men vulnerable, but that lack of vulnerability makes men commit suicide at high rates 3.5x that of women in the USA, because men cannot ask for help, affection, intimacy... things they need but pretend they don't because it just wouldn't be macho.