"Then King Solomon swore by the Lord: 'May God deal with me, be it ever so severely, if Adonijah does not pay with his life for this request! And now, as surely as the Lord lives - he who established me securely on the throne of my father David and has founded a dynasty for me as he promised - Adonijah shall be put to death today!' So King Solomon gave orders to Benaiah son of Jehoiada, and he struck down Adonijah and he died." NIV translation
As we have seen, Adonijah's talk was cheap and did not match his actions.
Therefore, Solomon sentenced him to die in keeping with the words that he had said when he came down from the altar (see 1 Kings 1:52).
This is a lesson for us as well in that, when we go to the altar for mercy, we must have a change of heart. This change of heart is known as repentance.
"To Abiathar the priest the king said, 'Go back to your fields in Anathoth. You deserve to die, but I will not put you to death now, because you carried the ark of the Sovereign Lord before my father David and shared all my father's hardships.' So Solomon removed Abiathar from the priesthood of the Lord, fulfilling the word the Lord had spoken at Shiloh about the house of Eli." NIV translation
Solomon spared Abiathar the priest but removed him from his office. He was remembered for the good things that he had done for King David. This was fulfilling the curse that was upon the house of Eli the unfaithful priest (see 1 Samuel 2:27).