Evolutionary pressure
I read an article fifteen or so years ago about bacteria evolving to become "nice" as their ability to spread is constrained. The primary example is diarrhea. At the time, it was near-fatal in India, required hospitalization in Mexico, and was almost completely benign in the US. Why? Because of sanitation practices. In an extreme case, there is a frog that can hibernate for years. With 50% of its blood volume the bacteria.
Attackers want money. What they DON'T want is to go to jail. Ransomware is pretty good for money, but it presses all the right buttons to get people to come after you, hard. OTOH, crypto mining is stealing electricity. This is a much more stable solution.