"Sloop John B" is a traditional West Indian folk song, and it was a huge hit for The Beach Boys in 1966. They tweaked the lyric, "This is the worst trip since I've been born" to "...I've ever been on" as a wink to acid culture.
Who writes a song about a name they found in a phone book? That's just one of the everyday things these guys find to sing about. Anything in their field of vision or general scope of knowledge is fair game. If you cross paths with them, so are you.