Unless those communities were sharing links to pirated content. If it was just talk about piracy and piracy news then I don't think that's a good reason to defederate.
Illegal in which country? Copyright infringement isn't illegal in my country for example, except for severe cases where you're profiting off of it. If we have to cater to all countries' laws we might as well ban music as well since it's illegal in Afghanistan.
Copyright infringement isn’t illegal in my country for example
You are not the one who would be tried and prosecuted for putting/allowing copyright infringing material onto the site.
Where the server is hosted and where the site admins live is what matters here. You expect them to risk criminal prosecution so that you can exercise your rights on a server that's outside your jurisdiction?
I'm assuming Germany. As I understand, lemmy.world's admin is Dutch, the servers are located in Finland and they are leased from a German company. So if piracy is illegal in any of these countries, they could get into trouble. From what I know, Germany is quite strict, so I'm guessing that is the concern.
There are many different laws with different countries. Don't forget that most (if not all) Fediverse instances are run by people in their free time with donations that just cover server costs. They aren't LLCs so there is always the concern about legal issues. Not sure if that is their motivation but could be part of it.