If there's someone out there who's considering another car that's a bit cheaper but would be willing to pay for a model X at this $10k-discounted price, they're getting a sale that they otherwise wouldn't get (albeit with lower margins). Meanwhile, people who aren't price sensitive will probably just buy the regular-priced one. They're presumably working on the assumption that profit from additional sales to people who would otherwise go with something else will outweigh any cannibalization of people who would pay for the higher-priced one taking the discounted one instead.
In this case, it's likely cheaper to make 1 battery and use it everywhere than it is to save a little on cells but have to manufacture a dozen or so bespoke batteries for all of their offerings.
The first car out of the factory cost billions to make. The next one a bit less, and so on.