The Twitter outbursts of Elon Musk are due to frustrations with what he sees as shortsighted views about the progress he's making with Tesla, former colleague Reid Hoffman told CNBC on Tuesday.

Musk is focused "three, five, 10 years into the future," said the LinkedIn co-founder, who worked alongside Musk at online payments system PayPal. "Part of his grit, part of his determination to get to that long future is to push back."

Just days after settling Securities and Exchange Commission fraud charges and just hours after a federal judge asked both sides to justify the agreement, Musk mocked the agency in a tweet lat week, calling it "Shortseller Enrichment Commission."

The SEC was going after Musk for alleged false statements in the now-infamous Aug. 7 tweet about having "funding secured" to possibly take the company private. The idea was abandoned on Aug. 24.

Prior to the take-private debacle, Musk had been acting erratically for months.

Following a bizarre Aug. 16 interview with The New York Times, Musk's actions were under scrutiny again last month after he appeared to smoke marijuana and drink whiskey during comedian Joe Rogan's podcast.

Back in May, Musk rudely cut off analysts on Tesla's first-quarter earnings call. He later apologized for that on the second-quarter call in August.

Shares of Tesla were up 3.2 percent Tuesday. But the stock has tanked more than 17 percent this year, and more than 25 percent over the last 12 months.

Appearing on "Squawk Box," Hoffman conceded that Musk should perhaps find a different outlet for his outbursts. "I think it needs to be a different pattern than those tweets."

Along with Musk, billionaire Hoffman is a member of the "PayPal Mafia," a group of former PayPal employees and founders who have since founded and developed their own tech companies. Hoffman is now with the Greylock Partners venture capital firm.