Why don't we have underground thermal power plants? I learned from wikipedia that for the production of electricity, the temperature of geothermal sources must be at least 150 degrees Celsius.
Also wiki says that at a depth of 6 kilometers, the temperature of the earth is about 270 degrees Celsius, that is more than enough to generate electricity. And this heat is not exhausted, because it comes from the core of the earth. So this energy can be called conditionally "infinite".
Why do we not have underground thermal power plants all over the world?
We have robots, rovers, drones and we know how to extract minerals... And also we can send robots to Mars! But here you need only 6 kilometers underground.
We can dig a separate hole in each area, 6 km deep, and have local free energy forever, or at least hundreds of years ahead.
Why doesn't anyone do this?
 A: The physics reason is that energy isn't generated directly from heat.  It's generated from heat reservoirs that are different in temperature*.  So if you dig a 6km deep hole and lower a thermal engine down into it, you now have to transport heat from your thermal engine to the surface to cool it.
The practical reason is that since you need the piping anyway, you may as well just have a heat exchanger down there.
The economic reason is that a 6km deep hole that's big enough, and the requisite insulated pipes and whatnot, costs a lot of money.  In order to be economically feasible you need to earn your money back before the plant wears out.  In order to be environmentally beneficial, you need to "earn back" whatever environmental damage you caused digging the hole and building the plant, again, before it all wears out.
* This is basic thermodynamics.  Try searching on "thermodynamics", "heat engine", or "Carnot cycle".
A: The main reason is that the most efficient way to get heat out of the depths and up to the surface is if the borehole is wet- that is, there's an aquifer down deep that is heated by the geothermal heat flux. then all you have to do is drill a well down into the layer of hot water and the pressure at that depth pushes the hot water to the surface, where you can use it to give up its heat to a heat exchanger containing the water you boil into steam to drive your turbines. This extra step is needed because the geothermal water is loaded with dissolved minerals that would otherwise foul the turbines.
This means that the borehole is going to be shallow (~hundreds of feet instead of ~thousands of feet) because there's no water ~6 kilometers down and for the water to be hot enough to use, there must be a local heat source down there- in the form of a mass of volcanic rock left over from some earlier eruption or magma movement in the past, which hasn't finished cooling off yet and is still super hot.
These thing occur naturally- like in Yellowstone Park, where the hot volcanic rock sits right under an aquifer full of water that the hot rock can get hot enough to create a steam explosion, yielding a dramatic thing called a geyser along with boiling mud pools and ponds full of water hot enough to kill you if you fell in.
There is one such geothermal field in California near the town of Calistoga where there are small geysers and hot springs. The local power company drilled into the hot (wet) rock and has been running turbines off that hot water for decades, but the overall operation is small and by now so much of the heat has already been extracted  that their power output is beginning to decline.
