This superstition really does originate 5,000 years ago in ancient Egypt. A ladder leaning against a wall forms a triangle, and Egyptians regarded this shape as sacred (as exhibited, for example, by their pyramids). To them, triangles represented the trinity of the gods, and to pass through a triangle was to desecrate them.