I think you have misunderstood the term "tragedy of the commons", which is a phenomenon distinct from a market failure. Also, "markets allocate resources based on supply and demand" is, I believe an oversimplification one should not carry beyond Economics 101. If that were sufficient to explain the totality of market behavior, especially at large scale, then the remainder of the discipline of economics need not exist.
That comment throws all econ 101 in the wrong way. A land owners decision to build a golf course over solar farm is a decision based on competing land uses which are demand/supply for land and the potential services you could provide on that land. Which is why you don't often see solar farms or farms or power plants in the middle of cities...