But paying people to be studied tends to be effective.
But I don't think the particular aspect of "making sure you have enough participants" interacts very much with ethics. Especially when the failure state in question is an honest failure to attract them.
In that case, someone at high risk for HIV infection could be prevented from getting treatment because of the study protocol. The ethical solution, which the authors of the study chose, was to provide the highest standard of care as the placebo - in this case it was Truvada.
Since the treatment was actually even more effective than the existing standard of care, it was a home run success. Their conclusion is even stronger than it would be if they used a non pharmaceutical placebo, so in retrospect their decision was clearly correct.
In this case the study cites that as being unethical due to the high prevalence of HIV in the target population. So the actual trial gave some people the shot, and some other people the known-working daily pills as a control.
Normally, some percentage of the population will get HIV in any given year. So what you do is give a bunch of people the shot and track them long term. You count how many got HIV after N years, compared to what would be expected in a normal population.
Nobody is exposed to HIV as part of the study, that exposure would come through the participants living their ordinary lives.