Costa elbowed, headbutted and spat in the face of Federico Di Francesco in the closing stages of a game in which Cristiano Ronaldo scored twice to give Juventus the lead.
Though Allegri felt Costa was provoked into his conduct late on at the Allianz Stadium, he also refused to use it as an excuse for the player’s actions.
"Maybe he was irritated at a foul before," the 51-year-old told Sky Sport Italia .
"But it doesn't matter, because this absolutely must not happen.
"The one thing we must avoid doing is falling for provocation.
“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 you get to situations like Douglas Costa."
"You just had to see the first three games and how close Ronaldo went to scoring," added Allegri.
"Again today, he was a little too hasty and eager to score, but it bounced off the post and right into his path. That unblocked him.
"Today, even though it was the first time with this system, we did well. Naturally, the full-backs have to give more width.
"Sassuolo fought hard and as they became tired later on, we took full control of the game."
The Serie A title holders will be looking to make it to a third final in five years, having lost to Barcelona and Real Madrid respectively in 2015 and 2017.