“for David.” The Messiah will be raised up “for David,” that is in fulfillment of the prophecy that the Messiah would come from the seed of David (2 Sam. 7:12; 1 Chron. 17:11-12), and as a blessing to David and “his house.” “David” is put by metonymy for “the house of David,” and then by extension includes all the people of God, who will be blessed by the Messiah.
“a righteous Branch.” This is one of the titles of the Messiah, Jesus Christ.
“justice and righteousness.” In this context, “righteousness” is doing what is right toward God and people, and in effect is “justice.” In Jeremiah 23:5, “justice” means more like “judgment,” that is fair and equitable judgment, thus justice. The emphasis is the effect: justice. In contrast, “righteousness” has more emphasis on the action; doing what is right to God and to fellow humans. There is no justice on earth now, but there will be in Christ’s Millennial Kingdom on earth. [For more on “righteousness” having the meaning of doing what is right or just (“justice”), see commentary on Matt. 5:6. For more on Christ’s future Millennial Kingdom on earth, see Appendix 3, “Christ’s Future Kingdom on Earth”].