Well, a few factors I'd consider here:
1. Per
Johns Hopkins University, there's a wide range of prices in the US — anywhere between $20 and $850 — to the consumer. Even if we take the median cost of $127, it's reasonable to assume the actual cost of manufacturing them and the advantage of buying in bulk probably means a lesser overall cost to any government. So your starting figure is a little uncertain.
2. Testing has likely caught cases that could've resulted in much worse community spread and economic impact than the cost of testing. This one is hard to quantify, of course, because you can't prove a negative. But statistically, and especially using the numbers you lay out, the odds seems likely.
3. For better or worse, until we get a lid on this, there's going to be some expense to mitigate/staff up/acquire testing materials/communicate with the population. The all-or-nothing alternative would be to give up trying to handle it altogether, and I don't know that anyone who is qualified to make that call is prepared to do that. But, is this spending being done responsibly? Are there bloat areas that could be cut or re-purposed? Fair questions that I don't think I'm informed enough to answer.
4. All the above being said, I think this snapshot in time is a perfect example of why countries ought to save up during the good times rather than rack up needless debt on vanity projects or programs that don't serve the greater good in some capacity. Countries entering this pandemic in debt — which, let's face it, was most of us — are going to have an infinitely steeper hill to climb when this is all over. A reduction in overall quality of living seems unavoidable at this point if we don't want to be servicing the debt forever.
That said, these are all the kind of high-level things that will need to be reckoned with. For now, the numbers are spiking in Ottawa because of the Omicron variant, which is a bit more pressing to me. By the time boosters become available, we'll be past the holiday season and probably staring another spike in the face. So with that context, especially as other cities across the world face similar resurgence, I say test away. Prevention over reaction every dang day of the week.