Nissan Motor Co.’s credit rating was slashed to junk by S&P Global Ratings, a blow for an automaker that has struggled to boost profitability in the years following former Chairman Carlos Ghosn’s arrest and the industry’s pivot toward electrification.