On the other hand, a business's mere existence doesn't entitle them to somebody else's market. If the people of Germany want to require social media businesses to make this data available to researchers, then that is simply the law of the land. It's really not up for X/Meta/etc to decide the rules of the market, nor do they have a "right" to do business without following said rules.
It would be one thing if the rules themselves were immoral or unreasonable, but I don't think this has anything to do with the rights of social media companies.