As always there are other considerations apart from purely economical ones. In Germany they are given weight while in the US their weight is often set at zero until there is a crisis.
There's a big difference between the US and Germany: the US has an awful lot of territory, so it can afford to waste and pollute large tracts of it (which it still does on a regular basis), yet have sufficient clean land for other purposes. Germany is a lot smaller and more densely populated, and it has to exercise a lot more caution with its environment than the US
Besides which, Europe as a whole seems to import 33% of its oil and 48% of its gas from Russia. Now consider that Russia seems to be sponsoring environmental groups in Europe that oppose fracking. Why would that be, you think?
Given Russia's showdown with the Ukraina (annexing the Crimea and turning the screws on by jacking up the price of natural gas) and Putin's determination to err ... restore Russia's political clout and former "glory", wouldn't you do your level best to try and worm your way out of energy dependence on Russia? The Germans seem to be doing exactly that.
In other news ... China is busily overtaking the US as largest economy, and it has no oil, no gas, but loads of coal. It's also the world's manufacturing hub. And then there's India growing steadily. Population growth in Asia is still massive (in absolute terms) and its prosperity is steadily rising. With that inevitably comes an increased energy footprint.
I believe than in the coming 10-20 years energy prices will be determined by what happens in Asia, not in the US or Europe. And the only way I see oil prices go in that period is up. Way up. Solar seems to be a pretty solid investment from that point of view.
So on balance I'd say that Germany's investment in solar energy is not a stupid move and should probably continue.