> Is that not charged via an alternator?
No, it's generally directly from main battery pack when the car is turned on, or when the car is charging. I would guses some models can also charge it now and then when the car is off, since some models are always connected to a cellular network.
> but then it seems more sensible to me to do away with the 12v battery all together.
No, no, no.. You need 12V when the car is off (for talking to key fob at the very least), but you probably don't want a DC-DC converter running from the main battery all the time. If you have trouble getting power from the main battery, it'll be hard to diagnose when none of the electronics work anymore. Having a redundant battery is a very good idea.
It's also a redundancy in case of emergency (some cars have buttons you can press to call emergency services).
I seem to remember Elon talking about removing it (of course), but they haven't yet, and I doubt they ever will.