Spongebob is a kids show, it is very popular, it is mostly appropriate (average innuendos here and there, some are just messed up some are just dumb), but marine biologist, animator, and director, Stephen Hillenburg could have used this origin idea. This is possibly the backstory. Some of this is true events, some is cartoon crap.
Many years ago, an army was testing nukes in an ocean. The toxic waste polluted the water (the cartoon stuff comes in right now exactly). The water then mutated the animals into walking, talking fish. Around 5 months later, (cartoon time) (will update this and add year in a different more detailed pasta) Sandy Cheeks, who is a squirrel who helped scientists explore and do research without them dieing. Sandy understands humans and had a camera strapped onto her whenever she was exploring.
One day the scientists had enough and wanted to start exploring themselves. So they thought a plan to lie to Sandy to get her killed. Their plan went like this, the scientists would lie to Sandy to get her to go into the ocean with the nuclear waste in it, and they thought even if they gave Sandy a suit, it would kill her, so they tried. They even gave Sandy the camera that she had strapped on, so she went down and it didn’t work. She didn’t die. Instead, she mutated and the pollution melted the camera but the suit survived and so did Sandy. The suit had oxygen so she was fine. She landed at the bottom and still thought she was working for the scientists. The scientists said to Sandy a long time ago this and exactly this, “Never tell anyone about us.” Sandy stayed true to that and hasn’t told anyone. She is stuck in the ocean but she likes it there.
Now a different part of the story, the buildings. The buildings were built by the fish of Bikini Bottom after the bombing. The scrap metal was what they used. That would explain the scrap metal looking buildings. Obviously, everything didn’t happen except the nukes thing. The army was dropping nukes in oceans, the rest was just cartoon stuff.