A King County Superior Court judge ruled that the grocer failed to take steps that could have stopped its pharmacies from filling millions of suspicious prescriptions.