It makes honest people feel rewarded, valued and acknowledge. It teaches people who wish to follow the rules and conform to social norms what those norms are and where we actually draw the line in practice.
https://en.wikipedia.org/wiki/Punishment#Education_and_denun...