There you go! If all you want is the cool, you can have it for almost free.
Trying to get heat the same way is a bit more work. What makes it worthwhile is that in mid-winter, the ground below frost level is warmer than the air.
Heat pumps that work on extracting heat from the air are at a bit of a loss to find any when the air is below freezing. They usually turn to straight electrical resistance heating. (Very inefficient.)
Contrariwise, ground source heat pumps can essentially cycle heat on an annual cycle. Note also that such set-ups can easily be supplemented with a passive solar gain for the heat source. Just pass a portion of your collector piping through something like a "cold frame".
Yup. Add the heat resulting from the extraction process and you get even more heat from each dollar spent.