Solomon is establishing his rule. Notice how David commands him to follow the law and deal with some people who were treacherous to him. David did not take revenge but he also knew justice needed done. Solomin wisely handled dispensing that justice not based on past actions but clear direction and purpose.
Here in many ways Solomon is like Christ. When Christ comes he will set up his kingdom in a just manner. What we do now will affect our entrance into that kingdom. Will you trust Jesus? Will you follow him?