You are entirely right that the initial cost is a lot more for the electric car, and comparing it to a cheaper gas car means you have a lot of ground to make up and it not be just a sensible financial decision on that basis. It's not going to be cheaper than a basic cheap gas car that can do the same. Like compare a 15k econo box to the cheapest currently produced long range (330 mile) tesla, which you can see at tesla.com.
I thought you were comparing it to an equivalent 'luxury car' with similar specs like a porsche or bmw. I'd compare an AWD M3 (priced at 63k) with an AWD bmw, priced at about 45k, both plus tax. Before Jan 1 you get a 7500 tax credit; after that you get half the tax credit, 3750 back. So that puts it at about 55k for ease of math. Now you want to get back 10k. Those cars are really really expensive for maintenance, that might get you the money back right there. But your fuel price will be about 1/4 the cost or even greater discount than the gas car. You'll never have an oil change, muffler, etc.
All that Tesla maintenance should be free, and they give you a loaner when they are broken. I got a tesla loaner when my car had it's problem that took a few days to fix. There have been some cars with problems. All things made by humans can break.
You'll be able to trade in the tesla for a decent amount of money but it doesn't make it free. As an example, my S is 3.5 years old and I was just offered half the original price as a trade in towards a model 3 - I decided not to do it because my car is working just fine. This was by far the most expensive car I've ever bought, more than double my previous cars. It's not about saving money, it's just so much fun to drive and there's no more fun tech toy I've ever seen. I can use it to go skiing (roof rack), taken multi-thousand mile trips. And you can do all that with a Toyota prius - that wouldn't be awd like my car so dodgy in the snow, but I could have bought a cheap awd drive. I never thought I'd spend more than 30 or 40k for a car, but my old car was 10 years old and I couldn't resist Tesla once I drove it.
The m3 is a much lower price point than the S. If you really wanted to try a tesla, I'd encourage considering a used S with a 4 year warranty from tesla included. See tesla.com or the third party listing site is better, ev-cpo.com. Since electric cars don't break down like regular cars, it's generally considered okay to drive them up to 100k miles. But you have to check out any used car even if you buy from tesla in person to make sure it is in proper shape. The cars come with an 8 year unlimited mileage for the drive train, increased over the original ones that had like an 8 year 100k mileage drivetrain warranty.