Actually, SpongeBob SquarePants isn’t a square. If each side of him were made up of a square, he would be a cube. However, since each side is a rectangle, but not necessarily a square, he is actually a rectangular prism.
The producers thought SquarePants sounded better than RectanglePants.