Automaking is a capital intensive, operationally complex, and fiercely competitive (read: low profit) industry. Apple's gross margin is nearly 3x higher than Tesla's, and Tesla will face increased margin pressure as more of the industry electrifies. Even if Apple were to match Porsche as the leader in volume+profit luxury automotive, it wouldn't be nearly as lucrative as their current businesses. There are other areas in which Apple could expand to more profitably leverage its core competencies.
Aside from all the difficulties that come with self driving, I suspect Apple cancelled its car effort because they couldn't figure out how differentiate its offering at a price low enough to drive volume and a cost low enough to drive comparable profit to its other businesses.