That feeling when the star wars exposure to ep 1 was due to my dad.
And even then, spongebob's early seasons were also pretty childish in humor, but the city of bikini bottom meanwhile was a reference to the US nuke tests on the bikini atoll (and the native inhabitants)
okey on point 1:
star wars had a pre-established audience and there would be a legitimate interest for adults to go, so making the movies also available for kids made the potential audience wider.
point 2:
spongebob's early seasons? they weren't childish, they were the most mature of the show. the rest of the series past Season 4 (including parts of even that season) is pretty childish. The reason why SpongeBob used to be a really enjoyable show even among the adults watching with their kids was because they wrote in a way to appeal to adults with the idea of introducing these concepts to children.
The episode "Hooky" is simultaneously a fun episode for kids about SpongeBob and Patrick goofing off but also a metaphor for drug addiction. The hooks are drugs; you can get a high but if you stay attached (and therefore hooked) bad shit happens to you.
Plenty of jokes intended for adults throughout the first 3 seasons.