Both laboratory and field evidence suggest that people tend to voluntarily incur costs to punish non-cooperators. While costly punishment typically reduces the average payoff as well as promotes cooperation. Why does the costly punishment evolve? We study the role of punishment in cooperation promotion within a two-level evolution framework of individual strategies and social norms. In a population with certain social norm, players update their strategies according to the payoff differences among different strategies. In a longer horizon, the evolution of social norm may be driven by the average payoffs of all members of the society. Norms differ in whether they allow or do not allow for the punishment action as part of strategies, and, for the former, they further differ in whether they encourage or do not encourage the punishment action. The strategy dynamics are articulated under different social norms. It is found that costly punishment does contribute to the evolution toward cooperation. Not only does the attraction basin of cooperative evolutionary stable state (CESS) become larger, but also the convergence speed to CESS is faster. These two properties are further enhanced if the punishment action is encouraged by the social norm. This model can be used to explain the widespread existence of costly punishment in human society