They have to operate within the laws of the countries they’re physically located in. Those countries want to know that they’re not hosting illegal content, providing services to crime rings, Russia or North Korea, etc.
If Hetzner allows you to host something and you use it for illegal acts, they aren’t going to jail to shield you for €10/month.
Hosting companies managed to shutdown illegal sites without requiring you to submit your pics and passport first.
And if someone wants to do illegal things, what's stopping them from submitting a fake ID?