So, I'm all for grow local, but when there's sun shining right outside - this doesn't make a heck of a lot of sense to me... unless you are a company that sells grow lights.
You have a point, but you also have to consider the context of comparison.
Plants grown outdoors face an array of problems that the farmer has to account for. Keeping insects off, keeping weeds at bay, keeping the plants watered and fertilized - all this comes at a cost to the farmer.
Indoor farming requires a more expensive infrastructure (the building, trays, and plumbing) but has great savings in some of the other areas. It's easier to keep weeds and insects out, for instance.
Of particular note, outdoors you can't recycle unused water or fertilizer, but this can be done indoors. Collect any unused water after the plants have drunk their fill, remove waste products, top off the fertilizer, and reuse.
So the economic question is this: is the extra money/effort spent on generating light compensated for by the savings in insecticides, roundup, fertilizer, and water?
I think the answer is probably "yes", given that LED lights are incredibly efficient. (Also of note: less of the environment is damaged by excess fertilizer and water drainage. Damaging the environment indirectly costs money.)
Then the next question is with the building: does it make sense to have big windows and use mostly solar light, and adjust as needed with indoor lighting?
Windows cost more than walls, they require extra heating and/or air conditioning, they're not as structurally sound, and the light isn't used efficiently in the 3-d volume; meaning, you can't grow corn on each story of a 5-story building, because the first layer will shade the ones below it. (And windows break, they have to be cleaned, they tend to leak, &c.)
It may be more economically sensible to grow corn in a 5-story warehouse close to a city simply because it reduces the transport costs. It also reduces the amount of land used - allowing more plots to go back to the wild.
And on top of all of this, researchers I've talked to are doing clever things with the light recipe they're giving to plants.
Some plants detect the reddening of the sun and "go to sleep" at sunset. By adjusting the light color, you can keep the plants growing 18 hours a day and then blast them with excess red light to get them to quickly go into night mode. This increases yield by reducing the growing period of their crops.
(A bunch of other experiments are really interesting, such as: hitting the crops with a particular frequency of light to cause their ripening flavors to go into overdrive, making a crop that is inordinately tasty.)
So in summary, we should do the economic experiment and see if it's viable, but in toto there's a lot to recommend indoor industrial gardening.