The forward was sent off on Sunday and his absence from the next three domestic games has annoyed his coach
The Italy international was sent off in the Rossoneri's 2-1 defeat against table-toppers Napoli on Sunday which will see him miss the next three domestic matches, including a Serie A clash with Juventus.
Allegri, who told his January signing publicly to "shut up" following the game, has insisted that Balotelli must be given more protection from officials in future but accepted that the striker needs to take it upon himself not to react rashly and cost his team-mates.
"Mario has made a mistake, penalising the team, club and the fans and he must change this," the coach told gathered media on Tuesday.
"Balotelli should help referees to protect him because if another player had suffered the fouls he did on Sunday then they would have whistled. The referees should be left alone because they can be influenced by negative attitudes.
"Mario is 23-years-old, he is no longer a child and to be a champion you have to have a correct behaviour because you are an example for all those who look up to you. I hope for him he benefits from it and realises that he's put the team and the club in difficulty.
"You have to go on the pitch thinking about doing well. When you finish the game you need to go in the dressing room, accept what happened and think of working to do better. The club will decide what to do about Mario."
Milan face Bologna on Wednesday as they bid to bounce back from the defeat which leaves them sat in 11th spot in Serie A.