Koulibaly was sent off 10 minutes from the end of Napoli's 1-0 defeat at the San Siro for two bookable offences. The setback left second placed Napoli nine points behind pacesetters Juventus who drew 2-2 at Atalanta on Wednesday afternoon.
Ancelotti told Sky: "It looks like an excuse but the player was agitated and irritable. It's not good, not for us, nor for Italian football. The solution exists. You have to stop the match. You just have to know when, after how many announcements. And if we don't know, then next time we may have to stop play ourselves."
Koulibaly was initially booked in the 80th minute for a foul on Matteo Politano and then shown another yellow card in the aftermath for sarcastically applauding the referee Paolo Silvio Mazzoleni.
The 27-year-old centre-back had been subjected to monkey noises from home supporters throughout the match.
"We asked three times for the match to be suspended and there were three announcements but the match continued," Ancelotti added. "The player was irritable and he wasn't in the best state of mind. Usually he's a very calm and professional player but there were these noises throughout the game."
Koulibaly apologised on Twitter for the defeat and being sent off but said: "I am proud of the colour of my skin. (Proud) to be French, Senegalese, Neapolitan: a man".
Inter's victory, courtesy of Lautaro Martinez's winner in second-half stoppage time, keeps them third but they move to within five points of Napoli.
Lazio are fourth, five points adrift of Inter after winning the battle of the brothers at Bologna. Lazio, coached by Simone Inzaghi, beat Pippo Inzaghi's side 2-0. Luiz Felipe and Nenad Lulic scored in each half for the visitors.