I mean even with low activity they are working and they don't harm anyone
This is a misconception. A site with low activity runs a very high risk of losing what small expert membership it may have (from boredom, burden, etc.), which in turn limits the site's utility to the internet at large.
One of the beauties of the Stack Exchange network is that people can ask questions and get fairly reliable answers in a respectable timeframe. Someone visiting a low activity site expecting the same level of response is very likely to find themselves disappointed, which weakens the reputation of the overall network.
A site that fails to attract enough membership to have a reasonable and sustainable level of activity is kind of like abandoned property. Left to sit unattended, it will become an eyesore, with less and less people to pull the weeds and water the grass. However, in tearing it down those concerns are removed, and the users are set free to find a more suitable area of the internet to call home.
That's not to say that closure is an expected potential outcome, of course. The goal is always for sites that get launched into beta to succeed, and closure is a last resort for when it becomes clear that simply isn't going to be the case. Low activity by itself doesn't make that indication though, so long as there are signs of growth.
The sites that do eventually get shut down are those that have very little sign of growth on top of levels of activity that barely register. For whichever of the many reasons discussed elsewhere, this trend indicates that these sites are just not workable within the Stack Exchange network at this time. As there's little incentive to maintain something that isn't working, getting rid of those sites and devoting the resources and energy to supporting the ones that are doing well seems like the wise thing to do.