BALTIMORE—Long burdened by one of the worst heroin problems in the U.S., Baltimore is joining a small but growing number of cities where police can divert low-level drug offenders to treatment, rather than send them to jail.

The move toward a diversion program—before an offender is booked on charges—is the latest sign of a shift away from a punishment-centered response to illegal drug use amid a growing view that the nation’s opioid crisis requires a public-health approach.

...