Tesla is more valuable than many of its rivals because of investors’ confidence in Elon Musk’s vision, but his ownership of Twitter and increasingly erratic behavior are eroding it.