It should be pointed out that these subsidies were in place well before Tesla existed as a company and were intended to encourage companies like GM, Ford, and Chrysler (as well as foreign companies) to try an invest in "green" automobiles. If the government is pouring so much money around that it is raining cash everywhere, you would be an idiot if you didn't pick up a bucket and start collecting that cash where it might do some good.
It also turns out that even with those subsidies they did almost no good. General Motors made the infamous EV-1 that turned out to be so expensive they wouldn't even offer the vehicles to be sold. The purpose of that vehicle really was to kill the subsidy and to in particular get the California Air Resources Board (the California equivalent to the EPA but operating at the state level) to stop making electric automobiles any sort of big deal. I guess that blew up really well.
Other automobile companies have tried to take advantage of those same subsidies. GM started the Volt literally right as it was going bankrupt and that was the only vehicle which survived the bankruptcy as a major engineering project. The Fisker Karma was actually built depending almost exclusively on those subsidies, and of course you have the Nissan Leaf.
If Tesla is able to make a business case for electric automobiles, I would dare say it is in spite of those subsidies instead of because of them. Yes, a thumb is on the scale in Tesla's favor, but they weren't really enough to make other companies profitable and there have been some spectacular failures and bankruptcies resulting from people other than Elon Musk trying to grab that same cash.
I also don't think the switch to electric automobiles is necessarily inevitable either. There are other "alternative fuel" sources which in theory could work out better as well. What makes electric vehicles work isn't the subsidies, but rather the energy density due to somewhat recent developments in energy storage technologies (aka batteries). It is also interesting that Tesla is now putting some significant money into basic R&D for that technology too and not simply waiting for some other company to come up with the next best thing.