Hello!
One of the problems of a free-market economy is that:
"Some socially desirable goods would simply not be produced by private enterprise. Who would carry out counter-terrorism activities if this were not funded by governments?"
I'm not sure about the following:
Socially-desirable doesn't seem to be a technical term to me. I think it simply refers to goods that give utility to every individual in the system. So if you assume that every individual is a rational agent, then in the absence of regulation, no one would pay for the good because everyone is waiting for everyone else to buy it for everyone to enjoy.
This will not apply to the solar panel example because a corporation that buys the panels can exclude other corporations from energy consumption. Counter-terrorism works because you can't limit the consumption of safety to a select group of individuals in your system.
Don't be lazy, there are a lot of resources in the internet on these issues.
http://en.wikipedia.org/wiki/Public_good