So, there's a major problem with this, and it has to do with how D&D lore handles the soul and the animating spirit. I don't fully understand it myself, but these are apparently two separate things. A creature without a soul is incapable of learning new information, as is the case with many types of undead. And yet, for some reason a creature's memories reside with the animating spirit. That's why a lot of soulless undead will mime actions and routines they did in life, and why they often retain any skills or knowledge they learned in life.
Contacting a person's soul, in the absence of their animating spirit, would produce essentially no useful outcome. The soul would have no memories, and thus nothing useful they could say back to you in return (unless you just really wanted to know what their afterlife was like). This is why Speak with Dead doesn't call up a creature's soul, but their animating spirit, and it's why you can't use Speak with Dead to pass information along to someone in the afterlife.