Because of the covenant that he had made with David; for which, in 2 Kings 8:19, it is for David his servant's sake, i.e. not for David's merits, but for God's free promise and covenant, as it is here explained.
Related Commentaries of 2 Chronicles 21:7
2 Chronicles 21:7
7 Howbeit the LORD would not destroy the house of David, because of the covenant that he had made with David, and as he promised to give a lighta to him and to his sons for ever.