The added price is likely partially due to the development costs for these companies retooling their factories and doing R&D to develop these new platforms in a company that has been building ICE vehicles for the past 50-100 years. Luxury vehicles bring a markup that helps to offset these costs until these vehicles become more ubiquitous, parts are easier to source, and prices come down. You can't compare the cost of a brand new design to something like the Camry which had the general design ironed out 40+ years ago.
If you look at sales numbers, the Model 3 is outselling the cheap alternatives like the Leaf and Bolt 20:1, so it seems like many people are willingly choosing to pay more rather than buy the econobox option. The average sale price for a (any) new vehicle is around $50k currently, and there are a multitude of options in that price range.