Because they cannot visit the athletes randomly. Because the athletes aren't training every day at a center, instead are training solo at lots of different places. Because much testing is tied to specific events (eg olympics) that have been cancelled. Cancel enough events and multi-month windows open where athletes know they will not be subject to testing.
And with fewer events, those that are still happening become much more important. If there is only one qualifying event on the calendar then there is all the more pressure to perform on that day. There is no point in saving anything for the rest of the season. So athletes will risk injury if that means doing a little better that one day. If they are hurt they know they will have have a long while to recover.
Assuming that the various lockdown protocols allow it. Many countries have had (or still have) massive intra-country travel restrictions, some such as Italy had periods of complete curfew.
Also, laboratories were generally either ordered or "volunteered" to prioritise covid19 swabs over drug tests.