When he originally announced it, it was the perfect excuse to sell off heavily overvalued Tesla stock.
At the same time, as one of the top 10 tweeters in the world, Elon Musk + Twitter is a big part of why Tesla doesn't need to run ads.
Twitter is also one of the main ways Elon gets with the ladies.
Elon may have fumbled this acquisition severely IMO. Twitter stock would've crashed more than Tesla stock did over the same period, but Elon was legally obligated to go through with it. He's now the bagholder for some overpriced shit.