With Musk, everything is a step towards the end goal(s), like colonizing Mars (which might even be the only goal since it ties everything together; it’s much easier to send humanoids to prepare for colonization and it’s not like HCI seems at all a priority unlike many other AI efforts).
My guess is that with Tesla, Musk aims to create AGI in a way he can control (as you may recall, he has previously talked about fears of the tech and control is a natural strategy to handle this). The cars are just the step that enables the next, so he basically just invests in the future over short term gains, which is a very reasonable business decision.
Custom silicon is likely unavoidable if you want to lead the AGI field, so he would just be investing in the next step of the plan. Tesla Bot is a good indicator of this direction.