Only particular people can inherit that which has been legally assigned to them to inherit. An inheritance typically is given once the person who named them in their will has died, and the portion of their estate designated for that named person is then handed over. Exceptions might be made by a living testator allowing a person to encash what would have been their share of the inheritance while both parties are alive. Jesus spoke of that with the younger son asking his father to give him his [future] share of the estate so that he could go off and enjoy the money there and then.
"The younger of [the two sons] said to his father, Father give me the
portion of goods that falleth to me. And he divided unto them his
living. And not many days after the younger son gathered all together,
and took his journey into a far country, and there wasted his
substance with riotous living..." (Luke 15:11-32)
At the last verse, when the son had repented and returned to his father, the father said to the indignant elder son that it was good to rejoice at his return to the household, "for this thy brother was dead, and is alive again; and was lost, and is found."
This has a direct bearing on the text you ask about, for it relates to spiritually dead people, spiritually alive people, and which of them will be given an inheritance in the Kingdom of God.
The point is made in the book of Hebrews that Christ is the mediator of the new testament, which is "a covenant for a Kingdom" (Luke 22:20 & 29, & Matthew 26:28 & 34). But this covenant had to be ratified by the death of Christ:
"And for this cause he is the mediator of a new testament [=
covenant], that by means of death, for the redemption of the
transgressions that were under the first testament, they which are
called might receive the promise of eternal inheritance. For where a
testament is, there must also of necessity be the death of the
testator. For a testament is of force after men are dead; otherwise it
is of no strength at all while the testator liveth." (Hebrews 9:15-17)
Now that Christ has died and has risen, those who are brought to spiritual life by faith of and in Christ become inheritors of the Kingdom.
"God has chosen the poor of this world, rich in faith, and heirs of
the kingdom which he has promised to those that love him" - James 2:5
Now the text in 1 Corinthians 6:9-10 becomes clear. It speaks of those who were not saved and, therefore, who would not inherit the Kingdom of God (location being beside the point here). Then it speaks of some of the Corinthian Christians who used to be in that 'prohibited' list of people who would not inherit, but "ye are washed, ye are sanctified, but ye are justified in the name of the Lord Jesus, and by the Spirit of our God."
Once a believer in Jesus is spiritually alive, having been spiritually 'washed' (cleansed), sanctified and justified, they are children of God - part of the family of God - and thus heirs of the Kingdom. Their portion in the Kingdom is secured because the testator (Christ) had died in order to effect the covenant for the Kingdom. They are legal inheritors due to the will of God who has 'named' them as his spiritual children. Alas, all the unrepentant sinners listed in verses 9 and 10 are not spiritual children of God, and so they are not heirs - they have no share in the spiritual inheritance due the children of God. They are not 'named' as heirs and inheritors of the Kingdom.