How do you feel about the fantasy/magic elements in Star Trek?

I'm talking about telepathic powers, non-corporal energy beings who can snap their fingers and do whatever, raising the dead on a few occasions, stuff like that. It always felt like a contradiction with Treks professed humanism. And as an atheist I never liked any of this stuff, but what do you think?