His firing comes after two difficult years in the top job and just days after the company’s board announced it was investigating him for alleged ethical lapses.