The ethical issue is that to study people taking an unproven vaccine, you do have to specifically have participants not take an existing well proven prevention medicine. Since existing prep works well enough that you would never be able to determine vaccine efficacy if they were using it. Having a vaccine is still strictly better, but that's the issue, not comparing to lifetime treatment.
To your uncertainty, effective treatment (reducing viral load to undetectable) reduces transmission to zero (https://www.niaid.nih.gov/diseases-conditions/treatment-prev...).