A willingness to abstain from sexual activity during the courting/engagement period would be strong evidence of the trustworthiness of one's future spouse.
Clearly STDs will not spread if young people practice abstinence before marriage.
Also, however, in a sinful and imperfect world, if one of the partners has not abstained before marriage and has been infected, it is still possible to deal with many of these infections with antibiotics or other medical treatment.
One reason they continue to spread is that people get re-infected or simply neglect to deal with the problem. Therefore in most cases faithful behavior after marriage would permit a medical cure and a fresh start.
Sometimes the material fruits of sin simply cannot be undone and must be lived with, but sometimes a new start is possible.