See https://towardsdatascience.com/statistics-and-unreliable-tes... for an analysis using Bayesian statistics that demonstrates why you would pre-filter who you give the test to, and why you shouldn't necessarily trust the test results after.
Please remember that public health organizations have over 150 years of experience with how to make the most effective use of existing resources to limit health challenges. This is a complicated optimization problem and the people doing it aren't stupid. It is better to ask why they do what they do than to assume that what they are doing makes no sense.