Diamond Foods will pay $5 million to settle civil charges that the company misled investors by lying to boost earnings.