Davy Jones' locker is just a regular gym locker that is filled with smelly socks. In the episodes it seems to have green goo at the bottom of it. The purpose of it is to torture whoever is in it but it is most likely a notorious bad place for sea creatures.
The legend of "Davy Jones' Locker" has existed in nautical folklore for many years, the first record being in 1726. In actual folklore, "Davy Jones' Locker" is a phrase meant to refer to the bottom of the sea, where drowned sailors and wrecked ships end up. The name "Davy Jones" is likely a reference to the ghost of Jonah, the biblical figure who was swallowed by a giant fish, and was released by God after praying to be rescued. However, the SpongeBob SquarePants series takes a different route, and uses the Monkees singer of the same name.