The idea of being buried in the sepulcher of one's father is practically synonymous with the theme of "sleeping with one's fathers" which is mentioned many times in the OT accounts of the kings and patriarchs. It has a similar meaning to our phrase "Rest In Peace." In primitive times, being buried in a different place than one's ancestors carried the connotation that one might not be at peace in the afterlife.
In the Bible, the tradition of burying a person in an ancestral tomb starts with Abraham, when he purchases a cave from the Hittites for that purpose:
Sarah died at Kir′iath-ar′ba (that is, Hebron) in the land of Canaan;
and Abraham went in to mourn for Sarah and to weep for her. And
Abraham rose up from before his dead, and said to the Hittites, “I
am a stranger and a sojourner among you; give me property among you
for a burying place, that I may bury my dead out of my sight.” ... So the field of Ephron in Mach-pe′lah, which was to the east of
Mamre, the field with the cave which was in it and all the trees that
were in the field, throughout its whole area, was made over to
Abraham as a possession in the presence of the Hittites, before all
who went in at the gate of his city. After this, Abraham buried
Sarah his wife in the cave of the field of Mach-pe′lah east of Mamre
(that is, Hebron) in the land of Canaan. (Gen 23)
Later, Abraham himself was buried in this cave, as were Isaac, Rebecca, Jacob and Esau. Later, in the final chapter of Genesis, the remains of Jacob were brought back from Egypt to be buried there as well.
Joseph spoke to the household of Pharaoh, saying, “If now I have found
favor in your eyes, speak, I pray you, in the ears of Pharaoh, saying,
My father made me swear, saying, ‘I am about to die: in my tomb which
I hewed out for myself in the land of Canaan, there shall you bury
me.’ Now therefore let me go up, I pray you, and bury my father; then
I will return.” And Pharaoh answered, “Go up, and bury your father, as
he made you swear. (Gen 50)
So we find a very ancient biblical tradition indicating the importance of being buried with one's fathers in an ancestral tomb.
The imprecation "thy carcass shall not come unto the sepulchre of thy fathers" is thus indeed a curse, meant to imply that the person will not rest in peace in Sheol but shall be tormented with loneliness and perhaps worse. The prophet's predication in 1 Kings 13 : 21-22 is mentioned again in 2 Kings 23. Here, King Josiah goes out of his way to desecrate the remains of the priests who worshiped at Bethel instead of Jerusalem. Interestingly, he does not disturb the tomb of either prophet mentioned in the OP.
And as Josi′ah turned, he saw the tombs
there on the mount; and he sent and took the bones out of the tombs,
and burned them upon the altar, and defiled it, according to the word
of the Lord which the man of God proclaimed, who had predicted these
things. Then he said, “What is yonder monument that I see?” And the
men of the city told him, “It is the tomb of the man of God who came
from Judah and predicted these things which you have done against the
altar at Bethel.” And he said, “Let him be; let no man move his
bones.” So they let his bones alone, with the bones of the prophet who
came out of Samar′ia.
To be buried in one's ancestral tomb, also called "sleeping with one's fathers" was thought to ensure one might not be totally alone in the afterlife. The tradition goes back to the time of Abraham, whose descendants took great care to be buried in their father's tomb. It is referred again and again in the history of the Kings of Judah and Israel. To predict that a person would not be buried in his ancestral tomb was a kind of curse, implying that one's situation in the afterlife would be one of complete isolation.