Motivation can often be like why everything is re-written: "Because we can" or just "Because it's there".
I'm not in the circle of these things, but history/news suggests that many are performed by those under the age of adult prosecution, or from countries that don't care, so there is minimal risk, and even when there is those involved are not the sort to believe they will get caught.
The Chinese government regularly targets GitHub because it hosts VPN software.
Has there been actual cases of prosecution?
https://krebsonsecurity.com/2023/02/finlands-most-wanted-hac...