It can unite a community (a common enemy or scapegoat leads community to unite to fight against it)
By rejecting the deviant behavior a community re-emphasizes what is considered "right" and "NORMAL" behavior (punishing a kid who steals in school: a teacher uses that kid as a example to the other kids of what not to do).
Deviance accepted and group benefits
Tolerance and care for deviant can lead to group solidarity
Deviance can give a community or group members chance to examine own behavior and to re-affirm common values keep them in place)
Deviance can be a warning signal (canary in a coal mine)
Deviance can be a way to let off steam (Mardi Gras, for example)
Deviance can be a way that groups test new ways of doing things — innovation.
A manifest function is the intended and obvious consequence of an action, behavior, practice or institution for the social system. The manifest function of college is training and credentials.
A latent function is an unintended and perhaps unrecognized consequence that benefits the social system. A latent function of college might be creating social circles not based on family of origin and sorting people into marriage classes based on career and social class.