I will focus on multiple ways a society or part of a population loose the interest or ability to sustain prostitution as a field of work. Some might not fit your particular setting, but might help others with the same question.
A: Polygamy is common, and there is no social incentive to pay for sex. You could look into societies alike to <PERSON>'s Brave New World, where children are raised by the community, and sexual exploration is a thing of the mundane.
B: The part of society relevant to your setting lives in utopian conditions, where money or personal belongings are a thing of the past. There is no financial incentive to take money in exchange for anything, including sex.
C: Your question states to avoid STDs. If the relevant population is misinformed about the dangers of prostitution (e.g. through religion or government programs) and has an enormously heightened fear of catching STDs from sex workers, social stigmas could increase to a point whereprostitution is basically nonexistent. Couple this with A or B maybe.
D: To focus more on the "bleak future" mentioned in the question and to give a counterpoint to B; The relevant population lives in dystopian conditions where personal belongings and privacy are a thing of the past. Because prostitution is a common business where poor living conditions prevail, you'll need total control of the citizens' lifes (similar to what <PERSON> mentioned in their answer). There is no need to go full 1984/concentration camp on this topic though; you can look at the living conditions in chinese factories (as outlined in this answer to a question regarding prison life) to get an idea of what's already sad reality. Government regulation for who's allowed to have children, combined with the absence of reliable contraceptives and privacy could make prostitution (and sex in general) too risky. 824
Note though that even in the aforementioned Nazi concentration camps, inmates had sex and raised children without being noticed by the guards. Depending on the level of technology in your world, this could be made near impossible though. Think implanted medical monitors that would alarm government officials when noticing a rise in certain hormone levels, or similar hard to circumvent measures. In the world of Æon FLux ... (spoiler)
!...the government controlled all food distribution. All people were sterile, but didn't know, and when a couple checked with a doctor wether they were pregnant, the doctors acctually injected hormones to make their bodies show signs of pregnancy. Fertilized eggs from a sperm/egg bank were implanted to allow for an actual pregnancy to occur. If I'm not mistaken, this partial plot summary is correct. I remember government distibuting food containing a 100% effective contraceptive too, but am not sure wether it was contained in this plot. Feel free to edit.
You could have a similar system in place, maybe with a sexual depressant in addition to the food contents mentioned in the spoiler. Government would have full control over who gets to reproduce, and there would be little use for prostitution. 238