You're arguing with hypotheticals even through real world examples exist.
Reddit has lots of porn and it's nowhere to be seen on the frontpage.
Allowing something doesn't mean you shouldn't classify it and filter it.
Reddit has a fundamentally different approach to front-page content and discovery, and moderation in general.
But even on Reddit, which is fairly permissive, they have hard boundaries which have little, if anything, to do with the "law".
This story is from 2013: https://www.pbs.org/newshour/classroom/2013/06/facebook-and-...
Maybe super early it was a free for all, but it had a lot less users then. The impacts mattered less.
These interventions became important as the companies grew, and needed to attract the largest possible number of users.
There are places with VERY open content policies. You can join them today.
Those places attract a niche audience and I'd wager always will.
If Facebook allowed pornography, it would quickly overwhelm the platform due to engagement metrics.
It would make the platform unusable.
Vile hate speech? Completely legal.
But its mere presence would turn away huge numbers of users.
It would make the platform unattractive and hurt the business.
It is in the platform's best interest to block otherwise legal things.