Role of reputation constraints in the spatial public goods game with second-order reputation evaluation