Lets take my city for an example. San Diego is doing about 5000 tests per day, just for the people that need them. Diverting staff to a road race - or other event - would take away the people who perform those tests while not being enough tests to cover a major marathon. Then there is the issue that the race would have to pay for the testing, which would be prohibitively expensive. Then what if there are false positives or false negatives - people getting sick or potentially suing the race because they travelled there, spent all that money, and now can't run. Its not like a false positive could just go on vacation either, they'd have to self quarrantine in their hotel for 2 weeks.
Its a nice idea in theory. Maybe a small field of elite athletes could be tested, but it doesn't work for a mass participation event.