But isn't putting something behind an age gate similar in concept to putting it behind a paywall? The speech is still there, whatever it may be, just has conditions for access.

"You can own a printing press, but we'll throw you in jail if you dare to show the printings to anyone."

The first amendment is a two way street. Everyone has an inalienable right to seek and read/view any media, and the government of the United States is forbidden from taking any actions that limit the mass dissemination of media.

The whole context of the amendment is existing governments preventing people from mass printing and distributing political pamphlets. "You can write something, but not distribute it" is entirely antithetical to the point of the amendment.

It would probably also be illegal for the government to mandate a paywall.

The issue is not that age gates are illegal, but that the government forcing people to use age gates is illegal.

But there are already laws that, for example, restrict children from buying pornographic magazines. These have been found by the Supreme Court to be constitutionally compatible. I don't see why this would be different with similar laws that apply to online services.

Generally speaking, things that you sell (the legal term is commercial speech, iirc) is more able to be regulated by the government.

The government can ban the sale of those things to minors, generally. So the category of porn sites that require a credit card and pay gate the content might be regulateable.

But that's not how places like pornhub or xvideos operate