Sketchy pornographic websites do have advertisers, just extremely low value ones. Twitter wants to maintain a pleasant environment for the medium to high value advertisers, because advertisers are its revenue stream, and primarily it is not an ideological entity, it is a profit seeking one. Ideology is a variable in the equation, but it is primarily and significantly bound by profit seeking.
So first, users are one of the major levers to keep valuable advertisers happy -- not the only one, but also not the only significant one, and they are purely instrumental. Second, Twitter does not want a negative public perception, along the lines of cable news, or much worse, 4chan. The former loses you a subset of a subset of the market and is a constant PR/lobbying headache, the latter loses most medium to high value advertisers altogether and is an existential regulatory threat. In almost no way is the worry that the toxic environment would be a subjectively bad experience for users.
Before Parler was banned from the App store (and before it was re-instated after more moderation was added), its stated policy was roughly to moderate strictly to what's within the bounds of the law, albeit with some significant inconsistencies especially around pornography and nudity. I used it during this time, and it was extremely common to see a lot of seemingly intentionally hateful but legal use of the n-word, etc. P&G, Nestle, etc., don't want to associate their brands with an environment like that. Obviously Apple didn't either.
It's important to always keep these realities in mind for all corporate action. Take Jack Dorsey's bluesky initiative[1], which many viewed in purely ideological or technical terms. My personal opinion is that it was either a way to counter negative PR ("Twitter is a moderated node that's profitable, but technically you can choose another node that's toxic and unprofitable but with less moderation, and good luck with that...", where Twitter gains all the "free speech" PR benefit with none of the significant costs), or a low cost self-soothing action to assuage pangs of guilt for instituting some policies he didn't personally agree with, with the important part that it is designed with a hard constraint to do nothing to negatively affect profits. So it's just an escape hatch for PR or personal angst.
[1] https://twitter.com/jack/status/1204766078468911106