The Securities and Exchange Commission has reached a settlement with Elon Musk over allegations he violated securities laws ahead of his purchase of Twitter.