Cristiano Ronaldo scored his first goals for Juventus but the champions' fourth win in as many games this season was overshadowed by Brazilian Costa's late red card for spitting at Di Francesco -- the 24-year-old son of Roma coach Eusebio Di Francesco.
"I would like to apologise to all the Juventus fans for my wrong reaction during today's game," wrote Costa on Instagram.
"I also apologise to my teammates, who are always by my side, in good and bad times. It was ugly, I am aware of that and I apologise to everyone for that.
"I want to make clear that this isolated conduct has nothing to do with what I've shown throughout my career."
Costa now faces an extended ban with coach Massimiliano Allegri annoyed with the forward for "rising to provocation".
"Maybe he was irritated at a foul before, but it doesn't matter, because these things should absolutely not happen. The one thing we must avoid is rising to provocation," said Allegri.
Ronaldo flicked in the first goal from close range in the 50th minute amid a scramble in front of goal, to euphoria at the Allianz Stadium, and grabbed a second 15 minutes later following a counter-attack involving Costa and Germany midfielder Emre Can.
Senegalese striker Khouma Babacar headed in a late goal for Sassuolo who fell to their first defeat of the season.
Just after Costa was given a yellow card for locking horns with Di Francesco, the two bickering players came together again and Costa elbowed his rival and than spat at Di Francesco's face.
The incident was referred to VAR and Costa was sent off by the referee.
"We could have scored a third goal, but instead we started to play as individuals, we tried to dribble past everyone, this wound up the opposition, who then reacted badly and then you get situations like Douglas Costa," said Allegri.
Allegri congratulated Ronaldo for breaking his duck before their trip to Spain to play Valencia in the Champions League next Wednesday.
"You just had to see the first three games and how close Ronaldo went to scoring," he said.
"I think he rushed a couple of chances today ?- it looked like he was absolutely desperate to score.
"Football has a way of evening things out and that was the story of the first goal, with the ball bouncing off the post and sitting up for him. The second goal was brilliant. I'm happy for him."