These launches are getting SpaceX the money to advance to methane-powered rockets: they will literally make rocket fuel out of air and sunlight, making them absolutely carbon neutral.
ISRU (what you're describing) does require a large amount of energy to do at scale. Also, ISRU has never been at the scale required to fully fuel a rocket.
There is a decent writeup on wikipedia[1] on how difficult this would actually be to do ISRU on mars. The TL;DNR is 56,200 meters squared of thin film solar panels. Granted, solar power is roughly half as effective on mars as it is on earth, but still. For reference, an American Football field is 7,140 meters squared.
Yes, the stated goal is the sabatier reaction from solar energy.
The apparent purpose of this is pretty much a tech-demo for mars. In terms of minimizing environmental impact on earth it would pretty clearly be better just to send the solar energy to the grid and divert natural gas that would have gone to generating electricity to launching rockets.