The concept of enclosed gardens with a spiritual purpose has ancient roots, tracing back to various religious and philosophical traditions. In the Judeo-Christian tradition, the Garden of Eden is often considered the archetype of a perfect, harmonious sanctuary. This paradisiacal garden represents a place of unspoiled beauty and communion with the divine.
Tracing the exact history of monastic gardens is a bit tricky, much of it being lost in the mists of time, but it would seem that the earliest written mention is from the Monastery of Montecasino, where Benedict of Nursia (around 500AD) established the Rule of Saint Benedict which would become a precept for western Christianity. He devoted a whole section of it to the importance of monastic gardens.