Firstly we have to establish who all of Israel is, remember the United Kingdom of Israel was divided after King Solomon's rule, God separated them into two different houses, the house of Israel, (the 10 northern kingdoms), and the House of Judah (Hebrews/Jews).
Not only was Israel divided, but God divorced the house of Israel, but not the house of Judah, even though they were just as bad.
Jeremiah 3:6-10
But she did not return. And her treacherous sister Judah saw it. Then
I saw that for all the causes for which backsliding Israel had
committed adultery, I had put her away and given her a certificate of
divorce; yet her treacherous sister Judah did not fear, but went and
played the harlot also. God did not divorce Israel because of the
promise he made to King David. God concludes, “Your house and your
kingdom will endure forever before me; your throne will be established
forever” (2 Samuel 7:16).
This last line is a reference to the Messiah, Jesus Christ, who Scripture tells us does indeed stem from the lineage of King David and whose kingdom we know truly has no end.
These promises are known as the “Davidic covenant,” and what is especially interesting and grace-filled about it is that it doesn’t place any sort of conditions upon it. God doesn’t say, “I’ll do this if you keep my Law” or “if you love Me.”
After divorcing the house of Israel, the northern ten tribes, he dispersed them into the nations, the Hebrew for nations is the Gentiles, like cream into coffee, we the church the nations the Gentiles are the house of Israel.
Amos 9:9
For, lo, I will command, and I will sift the house of Israel among all nations, like as corn is sifted in a sieve, yet shall not the least grain fall upon the earth.
Hosea 8:8 also supports this.
Israel is swallowed up; now she is among the nations like something no one wants.
But God promised he would come back for the house of Israel, and reunite both houses Ezekiel 37.
Say unto them, Thus saith the Lord God; Behold, I will take the stick of Joseph, which is in the hand of Ephraim, and the tribes of Israel his fellows, and will put them with him, even with the stick of Judah, and make them one stick, and they shall be one in mine hand.
This is what Paul means by all of Israel.
This is what Paul explains on Ephesians 2:15.
Having abolished in his flesh the enmity, even the law of commandments contained in ordinances; for to make in himself of twain one new man, so making peace; this is in contrary to the dispensationalist view.
This is why Paul starts on Romans 11:1
say then, Hath God cast away his people? God forbid. For I also am an Israelite, of the seed of Abraham, of the tribe of Benjamin. 1 I ask, then, has God rejected his people?
It's because the roots of dispensationalism were playing out at that time, as the majority of Jewish churches and congregations were overrun with believing Gentiles.
The reason he divorced the house of Israel was to implement God's plan of redemption.
According to the law of Moses after a divorce the bride can only remarry after the ex-groom dies, hence why Jesus died, and why Jesus said.
Mathew 15:24
But he answered and said, I am not sent but unto the lost sheep of the house of Israel.
This is how his plan of redemption saved the whole world because the Gentiles became the house of Israel because God divorced and dispersed the northern ten tribes (the house of Israel), into the nations to become the gene pool of the house of Israel, then to reunite both houses as Jeremiah 31:31-34 establishes.
31 The days are coming,” declares the Lord, “when I will make a new covenant with the people of Israel and with the people of Judah. 32 It will not be like the covenant I made with their ancestors when I took them by the hand to lead them out of Egypt, because they broke my covenant, though I was a husband to them,” declares the Lord. 33 “This is the covenant I will make with the people of Israel after that time,” declares the Lord. “I will put my law in their minds and write it on their hearts. I will be their God, and they will be my people. 34No longer will they teach their neighbor, or say to one another, ‘Know the Lord,’ because they will all know me, from the least of them to the greatest,” declares the Lord. “For I will forgive their wickedness and will remember their sins no more.”
Praise be to God for his beautiful plan of redemption to save and reunite the world.