There seems to be Three possible reasons for it being bad luck Two European One Egyptian
Walking under a ladder leaning against a wall resembled the gallows so walking under guaranteed your demise
Second was the ladder leaning against the wall was a triangle and that represents the Trinity (Theres my Catholic childhood coming out)
and it was blasphemous
And the Egyptian version also based itself on the triangle The triangle held special powers Look at there little headstones they made
So you were reducing or breaking the power of the triangle by walking under the ladder Even today many alternative people love their triangles