|Holy Trinity - 3 doors - by stevecadman|
The answer is that the number 9 is associated with luck. This it seems goes back to biblical times. We know about the holy trinity: God the father, the son and the holy ghost - three entities.
People like the idea of three. Three is a better number than two. Apparently it used to be be God the father and son (2). But the holy ghost (or holy spirit) was added as it was a better concept.
To that we can add the "three qualities of the universe: Time, Space, and Matter" (1). And thus we have 3 x 3 = 9 - the trinity of trinities.
In medieval times, numbers had more significance. They still do. But in ancient times numbers had a mystical quality and were, for example, incorporated into architecture.
Note: (1) Source: What is Biblical Numerology?