The share of U.S. workers testing positive for illicit drug use reached its highest level in a decade, according to data from millions of workplace drug tests administered by Quest Diagnostics Inc., one of the nation’s largest medical-screening laboratories.

Detection of illicit drugs—from marijuana to heroin to methamphetamine—increased slightly both for the general workforce and the “safety-sensitive” workforce, which includes millions of truck drivers, pilots, ship captains, subway engineers, and other transportation workers....