Walmart reached a $50 million settlement with the Department of Justice and Drug Enforcement Administration following allegations that it filled thousands of invalid opioid prescriptions.