People don't usually use these tests to prevent transmission, but to have a formal negative test result, as this is the entry ticket to many shops and services. A proof of vaccination provides the same, while also reducing transmission.
A vaccinated person may only spread if they are indeed infected, which is less common to begin with. Then, if they are indeed infected, the rate of transmission is much lower - as they usually don't develop heavy viral loads.
Um, this is the case also for the unvaccinated.
False-negative results exist.