Many rapid tests are indeed not accurate[1] but they still serve a purpose, depending on the sensitivity and specificity of the tests[2].
For the rapid tests with high sensitivity and you get a positive result, it's highly likely you have COVID.
For the rapid tests with high specificity and you get a negative result, it's highly likely that you don't have COVID.
And the public health measures of testing / contact tracing ONLY works if testing results come back quick. PCR tests are neither fast nor cheap, so those are not as effective in prevention of spreading because you don't do those all the time (slow + expensive).
Medcram has a good video talking about this. [3]
[1]: https://www.wsls.com/news/local/2021/01/08/cdc-study-shows-c...
[2]: https://en.wikipedia.org/wiki/Sensitivity_and_specificity