It all comes down to the labor agreement.
Any search and seizure without a warrant is considered unconstitutional except for a few specific exceptions, at least for criminal prosecution purposes.
"No warrant shall issue except upon probable cause"
Therefore, the only way you can get around that is by a voluntary waiver of that right. Agreement to a labor contract can include that waiver, and I'm sure those jobs that allow it have negotiated that voluntary agreement as a term of employment. Baseball has it too- it's part of the collective bargaining agreement. They can't prosecute you for refusing, but they can fire you if you do.
We also allow it for drivers, under the Implied Consent law, which says that you accept the right of police to demand a drug/alcohol test FOR CAUSE as a condition of getting a driver's license. You refuse, and they take your license away.
Long story short is that a search of the body and taking of bodily product is considered to be extremely invasive, and there are lots of legal hoops to jump before you can require someone to do it.