One thing the storyline with Data forgot is that whenever you hit his off switch, he's completely off. Switch him back on, he's conscious again, like a computer.
Same thing with the Doctor on VOY and he had much more emotional expression than Data.
It seems like the show takes a materialist view and strongly suggests he doesn't.
And yet on Voy there was an episode with Chakotey where he was out of his body and wandering the ship as neural energy or something.
The shows teeters back and forth on whether there is "something else" out there.
This is because depending on the episode, the story either needed the concept of a soul, or it didn't.
Like the episode where Janeway is being coaxed to go to the "afterlife" with her "father". Obviously something that wasn't her body would have gone.
Yet another episode, like when Neelix dies for 16 hours and is resurrected feels a loss that he didn't end up under that great tree in his "afterlife". That episode heavily implies there is no soul.
And many other examples. Trek seems to pick and choose depending on the story they want to tell.