There’s no doubt that the three kingdoms in D&C 76 have terminology related to 1 Cor 15. However the tendency of Mormons to read 1 Cor 15 in terms of D&C 76 is unfortunate. While they’re related somewhat they’re ultimately addressing very different topics. 1 Cor 15:39-44 is about the nature of resurrected bodies. D&C 76 is about the kingdoms and who is in them. That’s somewhat tied to resurrection since one goes to a kingdom after the resurrection but we should keep the two somewhat separated.
The word “terrestrial” in 1 Cor 15 doesn’t mean the terrestrial kingdom. Rather it means earthly or mortal. So verse 40 talking about “celestial bodies and bodies terrestrial” is literally talking about resurrected heavenly bodies and earthly mortal bodies. People get confused because terrestrial or earthly is also the name D&C 76 gives to the middle kingdom.
Now contrary to some critics, this doesn’t mean the Mormon use of 1 Cor 15 is far fetched. Far from it. For one the glory or splendor of the heavenly bodies is given in verse 41. It’s true one could read 41 as just saying that just as the sun, moon and stars differ in glory so too does a resurrected body from a mortal body. However if that were the only comparison, why list all the heavenly bodies plus the differing lights of the stars? I think the better reading is that verse 41 is distinguishing the types of bodies among the heavenly bodies. That is the resurrected bodies.
An important context for 1 Cor 15 is 2 Cor 12. At the time of Paul apocalyptic literature like 1 Enoch was extremely popular. These usually involved a major figure like Enoch, Isaiah, or Abraham ascending to heaven. Each level involved a new heaven or at least new chamber. As the ascent progresses each level is accompanied by a higher degree of glory. As one ascends one becomes more and more like God. Often as one goes through each step one receives new garments. Those are typically symbolic of a new type of body.
Many scholars tie 2 Cor 12 where Paul seems to be asserting that he ascended to paradise, the third of seven heavens. Many scholars see a close similarity between Paul in 2 Cor 12 with the apocalypse The Ascension of Isaiah (6-11). 1 Cor 15 is frequently seen as apocalyptic in nature and derived from apocalypses like Dan 7 & 12. We use the term kingdom rather than heaven (as is typical in apocalypses) but the idea is the same. Given 1 Cor 15 is apocalypse influenced and 2 Cor 12 is as well, it is most likely that the ascent through heavens also involves bodies as well. The afore mentioned Ascension of Isaiah has Isaiah receiving new garments at each heaven during the ascent. These clearly are bodies and it also seems like his earthly body has been left on earth during the ascent.
So while it’s fair to rib Mormons a bit for misusing the term “terrestrial” in 1 Cor 15 to apply to the terrestrial kingdom and the associated resurrected body, the general thrust Mormons take from the passage seems correct. That is Mormons take there to be multiple heavens tied to the heavenly bodies of the sun, the moon, and the stars. Heavenly ascents, whether Christian, Jewish, or pagan, often tie the heavens to these heavenly bodies. They often differ in how these are used of course, but D&C 76’s use is actually pretty in keeping with the culture of Paul.
Likewise the idea that those less righteous are kept at the lower levels of these heavens is fairly common in apocalypses. So for instance in the third heaven many apocalypses not only locate paradise, where the righteous go after they die, but also a place for the torment of dead humans. What we’d call hell. Now D&C 76 while it talks of hell and paradise as the intermediate location people await the resurrection doesn’t technically locate them in any of the kingdoms.
Overall while there are there are a few oddities to D&C 76 it really is quite in keeping with the late antiquity context to Paul’s letters to the Corinthians. The biggest issue is using “terrestrial” to apply to one of the kingdoms and then the neologism of “telestial” to apply to the lowest kingdom. While there have been lots of theories to the naming, it seems likely “terrestrial” gets adopted from 1 Cor 15 but it’s not clear why.
There are a few theories for the origin of telestial. Kevin Barney takes it as just meaning “far” or far from God. He also notes that with a cosmology of underworld, earth, and heaven that terrestrial and celestial would make sense with the underworld having a teles term. I confess that while that makes some sense, the problem is that the telestial kingdom is a heavenly kingdom and not the underworld out of which people are taken. Steve Flemming has suggested that telestial comes from telestic in the platonism of Iamblichus as translated by Thomas Taylor. While I was initially taken with that as I’ve thought more about it I have a harder time reconciling it with what’s described in D&C 76.
Even if we can’t really explain the terminology we’ve adopted, the underlying ideas of Mormon thought do seem to line up with Paul fairly well.
 See for example Gooder’s Only the Third Heaven?: 2 Corinthians 12.1-10 and Heavenly Ascent. It is a common connection to 2 Cor 12 though.
 This is common in many apocalypses but Apocalypse of Abraham 15:7 has men in the fires of Gehenna in the third heaven. In the Testament of Abraham he sees the salvation and punishment of souls (11:1-12:18)
 Outer darkness is the exception. D&C 76 basically presents hell as the waiting place as drawing out its dead as they accept Christ in varying degrees. Those who refuse to fully accept him ever basically are taken out of hell at the end of everything and put in the telestial kingdom. However there are those who remain there with the devil and are never redeemed.